PHP Classes

PHP Cron: Parse cron schedules to find when cron job ran

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 56%Total: 6,316 All time: 342 This week: 39Up
Version License Categories
phpcron 1.0.0GNU General Publi...Time and Date, Files and Folders, Sys...
Description 

Author

This class can parse cron tab schedules. It does not parse cron tab files themselves, but instead, can determine when a cron job should have last run, given the schedule in cron tab format (like 0 5 * * 1-4)

It can determine when a cron job should have last run, which can be used in conjunction with database logging to determine if a backup cron server should run a job or to create a complete PHP alternative to cron (maybe distributed across several servers). Updated with some example code and documentation explaining how it might be implemented.

Innovation Award
PHP Programming Innovation award winner
June 2005
Winner


Prize: One subscription to the PDF edition of the magazine by PHP Architect
Cron is a popular tool on Unix/Linux systems that can execute periodic jobs given a schedule definition. The job schedule definitions are stored in files named cron tabs.

This class can parse cron tab files to retrieve the schedules of the jobs that are defined. It can be useful to determine when was the last time or will be the next time that a jobs will be executed. It can be useful to applications that depend on the knowledge of the scheduled jobs.

Manuel Lemos
Picture of Mick Sear
Name: Mick Sear is available for providing paid consulting. Contact Mick Sear .
Classes: 8 packages by
Country: United Kingdom
Age: 51
All time rank: 372 in United Kingdom
Week rank: 195 Down8 in United Kingdom Down
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

  Files folder image Files (3)  
File Role Description
Plain text file CronParser Class Class to interpret cron schedule
Accessible without login Plain text file Cron_parser_documentation.txt Doc. Documentation on intended usage
Accessible without login Plain text file example.php Example Example of use

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:6,316
This week:0
All time:342
This week:39Up
User Ratings User Comments (1)
 All time
Utility:70%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:70%StarStarStarStar
Examples:70%StarStarStarStar
Tests:-
Videos:-
Overall:56%StarStarStar
Rank:1802
 
entrusting
7 years ago (muabshir)
80%StarStarStarStarStar