PDA

View Full Version : Are these crons right?



Moh
20-12-2008, 11:03 PM
I'm not very good with crons, and they always fail on me.
So are these crons right. 1s to run weekly and the other to run monthly.

Weekly:

Command:
php -q /home/user/public_html/cron/weekly.php

Minute(s):
0
Hour(s):
0 = 12 AM
Months(s):
Every Month
Day(s):
Every Day
Weekday(s):
Sunday


Monthly:

Command:
php -q /home/user/public_html/cron/monthly.php

Minute(s):
0
Hour(s):
0 = 12 AM
Months(s):
Every Month
Day(s):
31
Weekday(s):
Every Day

iUnknown
21-12-2008, 12:04 AM
To an advanced user, 0 0 1 * * is a cron job running on the first of every month at 0AM. And for monthly you'd do 0 0 * * 1 - the 1 on the end being Monday, every monday at "0:0" (first two zeros) - midnight. If it was 0 1 * * 1 then it would be 1AM on monday, and so on. Tuesday at midnight would be 0 0 * * 2 (second day of the week) etc.

Reasonably straight forward.

Want to hide these adverts? Register an account for free!