Home โบ Cron errors โบ Crontab
crontab error: bad day-of-week
crontab: installing new crontab
"/tmp/crontab.xxxx":1: bad day-of-week
errors in crontab file, can't install.Why this happens
Day-of-week is 0-7 in crontab, where both 0 and 7 are Sunday. 8 is out of range.
Wrong and right
0 0 * * 8Our parser says: dow value 8 is out of range (0-7)
0 0 * * 1At 00:00 UTC, on Mon. First runs after 1 Jan 2027 (UTC): Mon 04 Jan, 00:00, Mon 11 Jan, 00:00, Mon 18 Jan, 00:00, Mon 25 Jan, 00:00, Mon 01 Feb, 00:00
How to fix it
- Use 1-5 for Monday to Friday and 0 or 7 for Sunday.
- Or use names: MON-FRI.
- Remember that Quartz numbers differently if you are copying from a Java project.
The Crontab format at a glance
Fields in order: minute (0-59), hour (0-23), day-of-month (1-31), month (1-12), day-of-week (0-7, 0 and 7 = Sunday).
Cron runs in the server's local time zone. Check it with the date command, or put CRON_TZ=Asia/Kolkata above the line on cronie-based systems.
The fixed schedule in other systems
If you are moving this schedule to another scheduler, these are the equivalents of 0 0 * * 1:
| System | Expression |
|---|---|
| Quartz | 0 0 0 ? * 2 |
| Spring | 0 0 0 * * 1 |
| Kubernetes | 0 0 * * 1 |
| AWS EventBridge | 0 0 ? * 2 * |
| Jenkins | 0 0 * * 1 |
| GitHub Actions | 0 0 * * 1 |
| node-cron | 0 0 * * 1 |
| Apache Airflow | 0 0 * * 1 |
| Azure Functions | 0 0 0 * * 1 |
| Google Cloud Scheduler | 0 0 * * 1 |
Try it yourself
The tester below starts with the fixed expression. Change it and watch the schedule update.
Your week at a glance
Upcoming runs
| # | Local | UTC | From now |
|---|
Copy-ready code
Frequently asked questions
Is 7 allowed?
Yes, as Sunday, in most crontab implementations (not in GitHub Actions).
More Crontab fixes
See the full Crontab cron builder or convert between formats.