mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-21 10:27:29 +00:00
combined all cronscripts into one master-cronfile (user only needs to add one file to the crontab);
This commit is contained in:
parent
d1d872942a
commit
9fdece761e
@ -123,8 +123,9 @@ if(!isset($settings['panel']['frontend'])
|
|||||||
include_once ('./updates/froxlor/upgrade_syscp.inc.php');
|
include_once ('./updates/froxlor/upgrade_syscp.inc.php');
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!isset($settings['panel']['frontend'])
|
|
||||||
|| $settings['panel']['frontend'] == 'froxlor')
|
if(isset($settings['panel']['frontend'])
|
||||||
|
&& $settings['panel']['frontend'] == 'froxlor')
|
||||||
{
|
{
|
||||||
if($settings['panel']['version'] == '0.9-r1')
|
if($settings['panel']['version'] == '0.9-r1')
|
||||||
{
|
{
|
||||||
|
@ -136,27 +136,6 @@ fwrite($debugHandler, 'Table definitions included' . "\n");
|
|||||||
fwrite($debugHandler, 'Database Class has been loaded' . "\n");
|
fwrite($debugHandler, 'Database Class has been loaded' . "\n");
|
||||||
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
||||||
|
|
||||||
// If one cronscript needs root, it should say $needrootdb = true before the include
|
|
||||||
if(isset($needrootdb)
|
|
||||||
&& $needrootdb === true)
|
|
||||||
{
|
|
||||||
$db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
|
|
||||||
|
|
||||||
if($db_root->link_id == 0)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Do not proceed further if no database connection could be established
|
|
||||||
*/
|
|
||||||
|
|
||||||
fclose($debugHandler);
|
|
||||||
unlink($lockfile);
|
|
||||||
die('root can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($db_root->password);
|
|
||||||
fwrite($debugHandler, 'Database-rootconnection established' . "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if($db->link_id == 0)
|
if($db->link_id == 0)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -198,45 +177,6 @@ fwrite($debugHandler, 'Froxlor Version and Database Version are correct' . "\n")
|
|||||||
|
|
||||||
$cronscriptDebug = ($settings['system']['debug_cron'] == '1') ? true : false;
|
$cronscriptDebug = ($settings['system']['debug_cron'] == '1') ? true : false;
|
||||||
|
|
||||||
$cronbasedir = makeCorrectDir($pathtophpfiles . '/scripts/');
|
|
||||||
$crondir = new DirectoryIterator($cronbasedir);
|
|
||||||
$cronfilename = basename($_SERVER['PHP_SELF'], '.php');
|
|
||||||
$cronscriptFullName = makeCorrectFile($cronbasedir . basename($_SERVER['PHP_SELF']));
|
|
||||||
$inc_crons = array();
|
|
||||||
foreach($crondir as $file)
|
|
||||||
{
|
|
||||||
if(!$file->isDot()
|
|
||||||
&& !$file->isDir()
|
|
||||||
&& preg_match("/^" . $cronfilename . "\.inc\.(.*)\.php$/D", $file->getFilename()))
|
|
||||||
{
|
|
||||||
if(fileowner($cronscriptFullName) == $file->getOwner()
|
|
||||||
&& filegroup($cronscriptFullName) == $file->getGroup()
|
|
||||||
&& $file->isReadable())
|
|
||||||
{
|
|
||||||
$inc_crons[] = $file->getPathname();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fwrite($debugHandler, 'WARNING! uid and/or gid of "' . $cronscriptFullName . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!' . "\n");
|
|
||||||
fclose($debugHandler);
|
|
||||||
die('WARNING! uid and/or gid of "' . $cronscriptFullName . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($inc_crons[0]))
|
|
||||||
{
|
|
||||||
natsort($inc_crons);
|
|
||||||
foreach($inc_crons as $cfile)
|
|
||||||
{
|
|
||||||
fwrite($debugHandler, 'Including ...' . $cfile . "\n");
|
|
||||||
include_once ($cfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($file, $crondir, $cronname, $cronscriptFullName, $cronfilename, $cronbasedir);
|
|
||||||
fwrite($debugHandler, 'Functions have been included' . "\n");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new idna converter
|
* Create a new idna converter
|
||||||
*/
|
*/
|
||||||
|
44
lib/functions/froxlor/function.includeCronjobs.php
Normal file
44
lib/functions/froxlor/function.includeCronjobs.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Functions
|
||||||
|
* @version $Id: $
|
||||||
|
*/
|
||||||
|
|
||||||
|
function includeCronjobs($path, $debugHandler)
|
||||||
|
{
|
||||||
|
$cronbasedir = makeCorrectDir($path);
|
||||||
|
$crondir = new DirectoryIterator($cronbasedir);
|
||||||
|
|
||||||
|
foreach($crondir as $file)
|
||||||
|
{
|
||||||
|
if($file->isDot()) continue;
|
||||||
|
|
||||||
|
if($file->isFile())
|
||||||
|
{
|
||||||
|
if(fileowner(__FILE__) == $file->getOwner()
|
||||||
|
&& filegroup(__FILE__) == $file->getGroup()
|
||||||
|
&& $file->isReadable())
|
||||||
|
{
|
||||||
|
fwrite($debugHandler, 'Including ...' . $file->getPathname() . "\n");
|
||||||
|
include_once($file->getPathname());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fwrite($debugHandler, 'WARNING! uid and/or gid of "' . __FILE__ . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!' . "\n");
|
||||||
|
fclose($debugHandler);
|
||||||
|
die('WARNING! uid and/or gid of "' . __FILE__ . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
59
lib/functions/froxlor/function.openRootDB.php
Normal file
59
lib/functions/froxlor/function.openRootDB.php
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Functions
|
||||||
|
* @version $Id: $
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function openRootDB
|
||||||
|
*
|
||||||
|
* creates a mysql-connection as root-user
|
||||||
|
* and stores it in the global variable $db_root
|
||||||
|
*
|
||||||
|
* @param int debugHandler (file-object)
|
||||||
|
* @param int lockfile (file-object)
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
function openRootDB($debugHandler, $lockfile)
|
||||||
|
{
|
||||||
|
global $db_root;
|
||||||
|
|
||||||
|
// If one cronscript needs root, it should say $needrootdb = true before the include
|
||||||
|
if(isset($needrootdb)
|
||||||
|
&& $needrootdb === true)
|
||||||
|
{
|
||||||
|
$db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
|
||||||
|
|
||||||
|
if($db_root->link_id == 0)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Do not proceed further if no database connection could be established
|
||||||
|
*/
|
||||||
|
|
||||||
|
fclose($debugHandler);
|
||||||
|
unlink($lockfile);
|
||||||
|
die('root can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($db_root->password);
|
||||||
|
fwrite($debugHandler, 'Database-rootconnection established' . "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeRootDB()
|
||||||
|
{
|
||||||
|
global $db_root;
|
||||||
|
if(isset($db_root)) unset($db_root);
|
||||||
|
}
|
68
scripts/froxlor_master_cronjob.php
Normal file
68
scripts/froxlor_master_cronjob.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Cron
|
||||||
|
* @version $Id: $
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once(dirname(__FILE__) . '/../lib/cron_init.php');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* include jobs that run always (5 minutes if cron is setup that way)
|
||||||
|
*/
|
||||||
|
includeCronjobs($pathtophpfiles . '/scripts/jobs/always/', $debugHandler);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* include hourly jobs
|
||||||
|
*/
|
||||||
|
$today = time();
|
||||||
|
if(date('i', $today) == '00')
|
||||||
|
{
|
||||||
|
includeCronjobs($pathtophpfiles . '/scripts/jobs/hourly/', $debugHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* include daily jobs (once a day)
|
||||||
|
*/
|
||||||
|
$today = time();
|
||||||
|
if(date('Hi', $today) == '0000')
|
||||||
|
{
|
||||||
|
includeCronjobs($pathtophpfiles . '/scripts/jobs/daily/', $debugHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* include daily jobs (once a day)
|
||||||
|
*/
|
||||||
|
$today = time();
|
||||||
|
if(date('dHi', $today) == '010000')
|
||||||
|
{
|
||||||
|
includeCronjobs($pathtophpfiles . '/scripts/jobs/monthly/', $debugHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
fwrite($debugHandler, 'Cronfiles have been included' . "\n");
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we have to check the system's last guid with every cron run
|
||||||
|
* in case the admin installed new software which added a new user
|
||||||
|
* so users in the database don't conflict with system users
|
||||||
|
*/
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid');
|
||||||
|
checkLastGuid($settings['system']['lastguid']);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* shutdown cron
|
||||||
|
*/
|
||||||
|
include_once($pathtophpfiles . '/lib/cron_shutdown.php');
|
||||||
|
|
||||||
|
?>
|
@ -17,10 +17,9 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$needrootdb = true;
|
openRootDB($debugHandler, $lockfile);
|
||||||
require (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
$Aps = new ApsInstaller($settings, $db, $db_root);
|
$Aps = new ApsInstaller($settings, $db, $db_root);
|
||||||
$Aps->InstallHandler();
|
$Aps->InstallHandler();
|
||||||
require (dirname(__FILE__) . '/../lib/cron_shutdown.php');
|
closeRootDB();
|
||||||
|
|
||||||
?>
|
?>
|
@ -21,8 +21,6 @@
|
|||||||
* @todo skip mail parsing after x bytes for large mails
|
* @todo skip mail parsing after x bytes for large mails
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$needrootdb = false;
|
|
||||||
require (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
$mail = new PHPMailer();
|
$mail = new PHPMailer();
|
||||||
|
|
||||||
//dont do anything when module is disabled
|
//dont do anything when module is disabled
|
||||||
@ -229,14 +227,4 @@ if($db->num_rows($result) > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,20 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
openRootDB($debugHandler, $lockfile);
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile! (Note: This "header" also establishes a mysql-root-
|
|
||||||
* connection, if you don't need it, see for the header in cron_tasks.php)
|
|
||||||
*/
|
|
||||||
|
|
||||||
$needrootdb = true;
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if table exists, otherwise create it
|
* Check if table exists, otherwise create it
|
||||||
@ -69,14 +56,4 @@ while($cronFileIncludeRow = $db->fetch_array($cronFileIncludeResult))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,19 +17,6 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile!
|
|
||||||
*/
|
|
||||||
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LOOK INTO EVERY CUSTOMER DIR TO SEE IF THERE ARE ANY .HTACCESS FILE TO "TRANSLATE"
|
* LOOK INTO EVERY CUSTOMER DIR TO SEE IF THERE ARE ANY .HTACCESS FILE TO "TRANSLATE"
|
||||||
*/
|
*/
|
||||||
@ -54,16 +41,6 @@ else
|
|||||||
fwrite($debugHandler, ' cron_lighttp.htaccess: You don\'t use Lighttpd, you do not have to run this cronscript!' . "\n");
|
fwrite($debugHandler, ' cron_lighttp.htaccess: You don\'t use Lighttpd, you do not have to run this cronscript!' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FUNCTIONS
|
* FUNCTIONS
|
||||||
*/
|
*/
|
@ -17,19 +17,6 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile!
|
|
||||||
*/
|
|
||||||
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LOOK INTO TASKS TABLE TO SEE IF THERE ARE ANY UNDONE JOBS
|
* LOOK INTO TASKS TABLE TO SEE IF THERE ARE ANY UNDONE JOBS
|
||||||
*/
|
*/
|
||||||
@ -257,24 +244,6 @@ if($db->num_rows($result_tasks) != 0)
|
|||||||
unset($where);
|
unset($where);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'last_tasks_run\' ');
|
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'last_tasks_run\' ');
|
||||||
|
|
||||||
/*
|
|
||||||
* we have to check the system's last guid with every cron run
|
|
||||||
* in case the admin installed new software which added a new user
|
|
||||||
* so users in the database don't conflict with system users
|
|
||||||
*/
|
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid');
|
|
||||||
checkLastGuid($settings['system']['lastguid']);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,20 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
openRootDB($debugHandler, $lockfile);
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile! (Note: This "header" also establishes a mysql-root-
|
|
||||||
* connection, if you don't need it, see for the header in cron_tasks.php)
|
|
||||||
*/
|
|
||||||
|
|
||||||
$needrootdb = true;
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TRAFFIC AND DISKUSAGE MESSURE
|
* TRAFFIC AND DISKUSAGE MESSURE
|
||||||
@ -388,14 +375,6 @@ while($row = $db->fetch_array($result))
|
|||||||
|
|
||||||
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'last_traffic_run\' ');
|
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'last_traffic_run\' ');
|
||||||
|
|
||||||
/**
|
closeRootDB();
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,21 +17,6 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile! (Note: This "header" also establishes a mysql-root-
|
|
||||||
* connection, if you don't need it, see for the header in cron_tasks.php)
|
|
||||||
*/
|
|
||||||
|
|
||||||
$needrootdb = false;
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RESET USED TICKETS COUNTER
|
* RESET USED TICKETS COUNTER
|
||||||
*/
|
*/
|
||||||
@ -49,14 +34,4 @@ if($cycle == '0'
|
|||||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `tickets_used` = '0'");
|
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `tickets_used` = '0'");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,10 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$needrootdb = false;
|
|
||||||
require (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
$Aps = new ApsUpdater($db);
|
$Aps = new ApsUpdater($db);
|
||||||
$Aps->UpdateHandler();
|
$Aps->UpdateHandler();
|
||||||
require (dirname(__FILE__) . '/../lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,21 +17,6 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile! (Note: This "header" also establishes a mysql-root-
|
|
||||||
* connection, if you don't need it, see for the header in cron_tasks.php)
|
|
||||||
*/
|
|
||||||
|
|
||||||
$needrootdb = false;
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ARCHIVING CLOSED TICKETS
|
* ARCHIVING CLOSED TICKETS
|
||||||
*/
|
*/
|
||||||
@ -63,14 +48,4 @@ while($row_ticket = $db->fetch_array($result_tickets))
|
|||||||
fwrite($debugHandler, 'Archived ' . $archiving_count . ' tickets' . "\n");
|
fwrite($debugHandler, 'Archived ' . $archiving_count . ' tickets' . "\n");
|
||||||
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'last_archive_run\' ');
|
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'last_archive_run\' ');
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -17,19 +17,6 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING REDUNDANT CODE, WHICH IS SOME KINDA HEADER FOR EVERY CRON SCRIPT.
|
|
||||||
* When using this "header" you have to change $lockFilename for your needs.
|
|
||||||
* Don't forget to also copy the footer which closes database connections
|
|
||||||
* and the lockfile!
|
|
||||||
*/
|
|
||||||
|
|
||||||
include (dirname(__FILE__) . '/../lib/cron_init.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END REDUNDANT CODE (CRONSCRIPT "HEADER")
|
|
||||||
*/
|
|
||||||
|
|
||||||
fwrite($debugHandler, 'Trafficreport run started...' . "\n");
|
fwrite($debugHandler, 'Trafficreport run started...' . "\n");
|
||||||
$yesterday = time() - (60 * 60 * 24);
|
$yesterday = time() - (60 * 60 * 24);
|
||||||
|
|
||||||
@ -229,14 +216,5 @@ if(date('d') == '01')
|
|||||||
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP()
|
$db->query('UPDATE `' . TABLE_PANEL_SETTINGS . '` SET `value` = UNIX_TIMESTAMP()
|
||||||
WHERE `settinggroup` = \'system\' AND `varname` = \'last_traffic_report_run\' ');
|
WHERE `settinggroup` = \'system\' AND `varname` = \'last_traffic_report_run\' ');
|
||||||
|
|
||||||
/**
|
|
||||||
* STARTING CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
include ($pathtophpfiles . '/lib/cron_shutdown.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* END CRONSCRIPT FOOTER
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -5,10 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_tasks.php
|
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/froxlor_master_cronjob.php
|
||||||
0 0 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_traffic.php
|
|
||||||
30 0 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_ticketarchive.php
|
|
||||||
0 1 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_used_tickets_reset.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_autoresponder.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_apsinstaller.php
|
|
||||||
*/30 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_apsupdater.php
|
|
||||||
|
@ -5,10 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_tasks.php
|
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/froxlor_master_cronjob.php
|
||||||
0 0 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_traffic.php
|
|
||||||
30 0 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_ticketarchive.php
|
|
||||||
0 1 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_used_tickets_reset.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_autoresponder.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_apsinstaller.php
|
|
||||||
*/30 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_apsupdater.php
|
|
||||||
|
@ -7,10 +7,4 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Please check that all following paths are correct
|
# Please check that all following paths are correct
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_tasks.php
|
*/5 * * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/froxlor_master_cronjob.php
|
||||||
0 0 * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_traffic.php
|
|
||||||
30 0 * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_ticketarchive.php
|
|
||||||
0 1 * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_used_tickets_reset.php
|
|
||||||
*/5 * * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_autoresponder.php
|
|
||||||
*/5 * * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_apsinstaller.php
|
|
||||||
*/30 * * * * root /usr/lib/php5/bin/php -q /var/www/froxlor/scripts/cron_apsupdater.php
|
|
||||||
|
@ -5,10 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q /srv/www/htdocs/froxlor/scripts/cron_tasks.php
|
*/5 * * * * root /usr/bin/php5 -q /srv/www/htdocs/froxlor/scripts/froxlor_master_cronjob.php
|
||||||
0 0 * * * root /usr/bin/php5 -q /srv/www/htdocs/froxlor/scripts/cron_traffic.php
|
|
||||||
30 0 * * * root /usr/bin/php5 -q /srv/www/htdocs/froxlor/scripts/cron_ticketarchive.php
|
|
||||||
0 1 * * * root /usr/bin/php5 -q /var/www/htdocs/froxlor/scripts/cron_used_tickets_reset.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/htdocs/froxlor/scripts/cron_autoresponder.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/htdocs/froxlor/scripts/cron_apsinstaller.php
|
|
||||||
*/30 * * * * root /usr/bin/php5 -q /var/www/htdocs/froxlor/scripts/cron_apsupdater.php
|
|
||||||
|
@ -5,10 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_tasks.php
|
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/froxlor_master_cronjob.php
|
||||||
0 0 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_traffic.php
|
|
||||||
30 0 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_ticketarchive.php
|
|
||||||
0 1 * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_used_tickets_reset.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_autoresponder.php
|
|
||||||
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_apsinstaller.php
|
|
||||||
*/30 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/cron_apsupdater.php
|
|
||||||
|
Loading…
Reference in New Issue
Block a user