Browsing articles tagged with " cron"
Oct
23
2011

PHP manage multiple cronjobs with a single crontab entry

In many php applications there are multiple tasks that need to be run via cron at different times. In a typical application you may be doing the following tasks via cronjobs : 1. Backup database. 2. Send out email to subscribers. 3. Clear temporary files. 4. Fetch xml feeds from some source and store them in database. So if you had separate php files doing these tasks , and had a cronjob entry for each [...]

Oct
23
2011

PHP check if a timestamp matches a given cron schedule

Above is an example of a given timestamp. And a cron schedule can look like this 0 5 * * * – which means run everyday at 5 hours and 0 minutes. Now in a php application you may need to test if a given timestamp , say 1319362432 matches a given cron schedule like 0 5 * * *. Here is a quick php function that can do this task. How does it work [...]