How browsers word it
| Vixie cron | "-":1: bad day-of-week |
|---|---|
| Vixie cron | "-":1: bad month |
| Vixie cron | "-":1: bad day-of-month |
Common causes
A weekday above 7
Weekdays run from 0 (Sunday) to 7 (also Sunday). Some people count Monday as 1 and stop at 7, which works, but 8 does not.
Input
0 0 * * 8
Cron Explainer says
dow must be between 0 and 7
A full weekday name
Names must be the three-letter abbreviations.
Input
0 0 * * MONDAY
Cron Explainer says
"MONDAY" is not valid for dow
A full month name
The same rule applies to months: JAN, not JANUARY.
Input
0 0 * JANUARY *
Cron Explainer says
"JANUARY" is not valid for month
A day of month above 31
Days of the month run from 1 to 31. Day 0 is not valid either.
Input
0 0 32 * *
Cron Explainer says
dom must be between 1 and 31
How to fix it
- Use 0 to 7 for weekdays, 1 to 12 for months and 1 to 31 for days, or the three-letter names MON and JAN.
- Count the fields: minute, hour, day of month, month, weekday, in that order.
- Run the line through the cron explainer: it names the field that is wrong.
- Remember that a month with fewer days, such as 31 in April, never runs.