- don't drop TABLE_PANEL_DISKSPACE and TABLE_PANEL_DISKSPACE_ADMINS (used in traffic-cron);
- using correct variable for sql-query in getNextCronjobs(); - let includeCronjobs() return the list of crons to run because of all the global variables; - include required classes/functions to cronfiles;
This commit is contained in:
@@ -64,8 +64,6 @@ if(isFroxlorVersion('0.9-r0'))
|
||||
$db->query("DROP TABLE `" . TABLE_BILLING_INVOICES_ADMINS . "`;");
|
||||
$db->query("DROP TABLE `" . TABLE_BILLING_INVOICE_CHANGES . "`;");
|
||||
$db->query("DROP TABLE `" . TABLE_BILLING_INVOICE_CHANGES_ADMINS . "`;");
|
||||
$db->query("DROP TABLE `" . TABLE_PANEL_DISKSPACE . "`;");
|
||||
$db->query("DROP TABLE `" . TABLE_PANEL_DISKSPACE_ADMINS . "`;");
|
||||
|
||||
/*
|
||||
* update panel_domains, panel_customers, panel_admins
|
||||
|
||||
@@ -26,7 +26,7 @@ function getNextCronjobs()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND (";
|
||||
$query = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND (";
|
||||
|
||||
$intervals = getIntervalOptions();
|
||||
|
||||
@@ -36,14 +36,14 @@ function getNextCronjobs()
|
||||
if($name == '0') continue;
|
||||
|
||||
if($x == 0) {
|
||||
$sql.= 'DATE_ADD(FROM_UNIXTIME(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
|
||||
$query.= 'DATE_ADD(FROM_UNIXTIME(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
|
||||
} else {
|
||||
$sql.= ' OR DATE_ADD(UNIX_TIMESTAMP(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
|
||||
$query.= ' OR DATE_ADD(UNIX_TIMESTAMP(`lastrun`), INTERVAL '.$ival.') <= UTC_TIMESTAMP()';
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
|
||||
$sql.= ');';
|
||||
$query.= ');';
|
||||
|
||||
$result = $db->query($query);
|
||||
|
||||
|
||||
@@ -15,23 +15,24 @@
|
||||
* @version $Id: $
|
||||
*/
|
||||
|
||||
function includeCronjobs($debugHandler)
|
||||
function includeCronjobs($debugHandler, $pathtophpfiles)
|
||||
{
|
||||
$cronjobs = getNextCronjobs();
|
||||
|
||||
$jobs_to_run = array();
|
||||
|
||||
if($cronjobs !== false
|
||||
&& is_array($cronjobs)
|
||||
&& isset($cronjobs[0]))
|
||||
{
|
||||
/*
|
||||
* @TODO find a better way for the path
|
||||
*/
|
||||
$cron_path = dirname(__FILE__).'/../../../scripts/jobs/';
|
||||
$cron_path = makeCorrectDir($pathtophpfiles.'/scripts/jobs/');
|
||||
|
||||
foreach($cronjobs as $cronjob)
|
||||
{
|
||||
$cron_file = makeCorrectFile($cron_path.$cronjob);
|
||||
include_once($cron_file);
|
||||
$jobs_to_run[] = $cron_file;
|
||||
}
|
||||
}
|
||||
|
||||
return $jobs_to_run;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,13 @@
|
||||
|
||||
include_once(dirname(__FILE__) . '/../lib/cron_init.php');
|
||||
|
||||
includeCronjobs($debugHandler);
|
||||
$jobs_to_run = includeCronjobs($debugHandler, $pathtophpfiles);
|
||||
|
||||
foreach($jobs_to_run as $cron)
|
||||
{
|
||||
require_once($cron);
|
||||
}
|
||||
|
||||
fwrite($debugHandler, 'Cronfiles have been included' . "\n");
|
||||
|
||||
/*
|
||||
|
||||
@@ -17,6 +17,15 @@
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* necessary includes
|
||||
*/
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.dns.10.bind.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.10.apache.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.15.apache_fcgid.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.20.lighttpd.php'));
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_tasks.inc.http.25.lighttpd_fcgid.php'));
|
||||
|
||||
/**
|
||||
* LOOK INTO TASKS TABLE TO SEE IF THERE ARE ANY UNDONE JOBS
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
openRootDB($debugHandler, $lockfile);
|
||||
require_once(makeCorrectFile(dirname(__FILE__) . '/cron_traffic.inc.functions.php'));
|
||||
|
||||
/**
|
||||
* TRAFFIC AND DISKUSAGE MESSURE
|
||||
|
||||
Reference in New Issue
Block a user