Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (2) | Download .zip | Reputation | Support forum (3) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2004-11-29 (11 years ago) | 55% | Total: 2,768 This week: 2 | All time: 1,319 This week: 591 |
Version | License | PHP version | Categories | |||
crontab 1.0 | GNU Lesser Genera... | 4 | Time and Date, Unix |
Description | Author | |||||||||||||
This class interfaces with the Unix/Linux crontab program to parse, manipulate and save the execution of scheduled programs. Recommendations What is the best PHP cron management class? |
|
cjpa's Crontab-class (c)2003-2004 (cjpa@audiophile.com) Some notes concerning the crontab-class. The class is pretty thoroughly documented, so i won't go into specifics here. Windows-users: Bad luck, this won't work on your system unless you have installed Cygwin and probably even then you'll need to adapt this class a bit. The following example will open the crontab-file of the user who is running the script, take the last entry from her crontab and add another crontab, 5 minutes later that does "ls -al". <--- SNIP ---> #!/usr/local/bin/php -q <?php include_once "Crontab.php"; $cron = new Crontab(get_current_user()); $min = ($cron->crontabs[count($cron->getByType(CRON_CMD))][minute] + 5) % 60; $hour = $cron->crontabs[count($cron->getByType(CRON_CMD))][hour]; if ($min < $cron->crontabs[count($cron->crontabs)-1][minute]) $hour = ($hour+1) % 24 ; $cron->addCron($min, $hour, "*", "*", "*", "ls -al"); $cron->writeCrontab(); ?> <--- SNIP ---> |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | User Comments (1) | ||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Pages that reference this package |
Help me in the work of Cron is very simple!! .. |