PDA

Bekijk Volledige Versie : cronjob



ShowU
03/01/07, 10:41
Ik heb een SupportTrio script geinstalleerd op een account en hierin bestaat de mogelijkheid om mails op een of andere manier via pop3 binnen te halen naar het supportticket systeem. Dit moet met behulp van cronjobs die om de X minuten kijkt of er mail is op de pop3.
Iemand enig idee hoe ik dit in moet stellen.
Dit is de code van php die de cronjob uit zou moeten voeren:

#!/usr/local/lib/php -q
<?php
/*

Cronjob For Checking POP Accounts

The first line of this file should be modified to the path of php on your server.
The rest of this file should remain unedited.

*/

error_reporting(E_ALL);
// set admin path
$adminPath = dirname(dirname(__FILE__));
$publicPath = dirname($adminPath);


// require main include file
require_once($adminPath . '/engine.inc.php');
set_include_path('.');


// Setting some php settings to avoid timeouts
@ini_set('max_execution_time', 950 * 60);
$ml = ini_get('memory_limit');
if ( $ml != 0 and (int)$ml < 64 ) @ini_set('memory_limit', '64M');
@set_time_limit(950 * 60);


// include everything we need
require_once($publicPath . '/functions/function_global.php');
require_once($adminPath . '/functions/function_global.php');
require_once($adminPath . '/functions/function_cron.php');
require_once($adminPath . '/functions/function_user.php');
require_once($adminPath . '/functions/function_ticket.php');
require_once($adminPath . '/functions/function_spam.php');
require_once($adminPath . '/functions/function_user.php');
require_once($adminPath . '/functions/mimeDecode.php');
require_once($adminPath . '/functions/POP3.php');
require_once($adminPath . '/functions/DatabaseTicketFile.php');

require_once($adminPath . '/functions/smarty.php');
require_once($adminPath . '/functions/smarty_plugins/modifier.i18n.php');


$site = tt_version();



// fetch installed languages
$languages = get_languages();
// change language if not found
if ( !isset($languages[$site['lang']]) ) $site['lang'] = 'english';

// Preload the language file
$langSet = ( isset($languages[$site['lang']]) ? $site['lang'] : 'english' );
$langFile = dirname(dirname(dirname(__FILE__))) . '/lang/lang.' . $langSet . '.txt';
// This function is from the smarty modifier php file
setLanguageArray( loadSmartyLangFile($langFile) );



define('PRINT_OUTPUT', false); // set to true if you want to see output what's happening (when accessing via browser)


// Running Pop Account Function
run_pop_accounts($site);


?>

Icheb
03/01/07, 14:50
Direct Admin?
Inloggen op het account waar het om gaat, de code vast even ergens neerzetten op een plaats die niet public is (anders gaan mensen de server proberen te overbelasten, als ze de URL ontdekken), en dan op het knopje 'cronjobs' rammen.
Het zal wel zoiets worden:
*/5 * * * * /usr/local/bin/php <plaats waar de file staat> >/dev/null

Jorem
03/01/07, 15:20
Heb net even lopen zoeken maar kan het zo niet vinden. In het forum moet je even kijken bij 12all. Daar moet ergens een handleiding staan voor opzetten van cronjobs. Neem aan dat dit bij 12all nagenoeg hetzelfde gaat als bij Support Trio, zelfde makers tenslotte.

ShowU
03/01/07, 16:32
*/5 * * * * /usr/local/bin/php <plaats waar de file staat> >/dev/null

het eerste gedeelteje snap ik ...
het stukje /usr/local/bin/php ook nog...
<plaats waar de file staat>
dat is dan bijvoorbeeld /domains/domeinnaam.nl/private_html/ ???
en waar staat /dev/null voor?

Bullcat
03/01/07, 17:14
zodat je niet bij elke uitgevoerde taak een email krijgt gestuurd !