A cron exception

Some time ago a workmate asked me why the next cron line didn’t work:

0 0 1 * 1 script

The script runs every monday at 00:00 and not only the mondays 1th, which should be the expected behavior.

That is because of a cron exception. A job is executed when all the time/date specification fields match the current time and date, but if both the day of month and the day of week are restricted (not “*”), then either the day of month or the day of week field must match the current day (even though the other does not).

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*Required Fields