Class Horde_Scheduler_Cron
Horde_Scheduler_cron:: Sort of a cron replacement in a PHP cli script.
Date Syntax Examples.
Remember: - Whitespace (space, tab, newline) delimited fields - Single values, sets, ranges, wildcards
SECOND MINUTE HOUR DAY MONTH * * * * * (every second) 0,30 * * * * (every 30 seconds) 0 0,10,20,30,40,50 * * * (every 10 minutes) 0 0 * * * (beginning of every hour) 0 0 0,6,12,18 * * (at midnight, 6am, noon, 6pm) 0 0 0 1-7&Fri * (midnight, first Fri of the month) 0 0 0 1-7!Fri * (midnight, first Mon-Thu,Sat-Sun of the month)
Example usage:
- Horde_Scheduler
- Horde_Scheduler_Cron
Author: Ryan Flynn ryan@ryanflynn.com
Author: Chuck Hagenbuch chuck@horde.org
Set_time_limit(0);: $cron = Horde_Scheduler::factory('Cron');
// Run this command every 5 minutes. $cron->addTask('perl somescript.pl', '0 0,5,10,15,20,25,30,35,40,45,50,55 * * *');
// Run this command midnight of the first Friday of odd numbered months. $cron->addTask('php -q somescript.php', '0 0 0 1-7&Fri 1,3,5,7,9,11');
// Also run this command midnight of the second Thursday and Saturday of the even numbered months. $cron->addTask('php -q somescript.php', '0 0 0 8-15&Thu,8-15&Sat 2,4,6,8,10,12');
$cron->run();Located at Horde/Scheduler/Cron.php
public
|
|
public
|
|
public
|
|
public
|
__construct(),
factory(),
serialize(),
sleep(),
unserialize()
|
public
integer
|
$_counter
Every time a task is added it will get a fresh uid even if immediately removed. |
#
1
|