"cron_help", "admin" => "cron_admin"); function cron_help() { ?>

Cron (which stands for chronograph) is a periodic command scheduler: it executes commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.

Note that cron does not guarantee the commands will be executed at the specified interval. However, the engine will make sure that the commands are run as close to the specified intervals as possible.

Check the documentation page for more information about cron and how to setup it correctly.

$value) { db_query("UPDATE crons SET scheduled = '$value' WHERE module = '$key'"); } } function cron_execute($name) { global $repository; watchdog("message", "cron: executed '". $name ."_cron()'"); $repository[$name]["cron"](); db_query("UPDATE crons SET timestamp = ". time() ." WHERE module = '$name'"); } function cron_display() { $intervals = array(300, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200); // Perform query: $result = db_query("SELECT * FROM crons"); // Generate output: $output .= "
\n"; $output .= "\n"; $output .= " \n"; while ($cron = db_fetch_object($result)) { foreach ($intervals as $value) $period .= "\n"; $output .= " \n"; unset($period); } $output .= "
moduleperiodlast runnext runoperations
". check_output($cron->module) ."". ($cron->timestamp ? format_interval(time() - $cron->timestamp) ." ago" : "never") ."". ($cron->timestamp ? format_interval($cron->timestamp + $cron->scheduled - time()) ." left" : "never") ."module\">execute
\n"; $output .= "\n"; $output .= "
\n"; print $output; } function cron_admin() { global $op, $edit, $name; print "overview | help
\n"; switch($op) { case "help": cron_help(); break; case "execute": cron_execute($name); cron_display(); break; case "Save crons": cron_save($edit); // fall through default: cron_display(); } } ?>