VTE CRON CONFIGURATION - Run automated operations without user intervention



Global setup
============

Make sure you have cron/RunCron.sh in your /etc/crontab system file.

Example:

*/1 *   * * *   root    /var/www/vte_root/cron/RunCron.sh >> /var/www/vte_root/logs/cron.log 2>&1




To create a new cron operation
==============================

1. Create a new php script inside the cron/ directory which does what you want.
Remember that when launched, this script will be executed from within another function,
so if you need global variables, declare them with "global".


2. To register it, launch the following php code

require_once('include/utils/utils.php');
$CU = CronUtils::getInstance();

$cj = CronJob::getByName('YourCronName');
if (empty($cj)) {
	$cj = new CronJob();
	$cj->name = 'YourCronName';
	$cj->active = 1;
	$cj->singleRun = false;
	$cj->fileName = 'cron/YourCronFile.php';
	$cj->timeout = 300;             // 5min timeout
	$cj->repeat = 600;              // run every 10 min
	$CU->insertCronJob($cj);
}

adjusting the variables accordingly to the desired behaviour.

3. You can later modify it editing the table vte_cronjobs

NOTE: all the logs for the cron jobs are in logs/cron/
