Cron Expression: 0 0 1 * *
0 0 1 * *
Run on the 1st of every month at midnight
Field Breakdown
| Value | Field | Meaning |
|---|---|---|
| 0 | minute | at minute 0 |
| 0 | hour | at midnight |
| 1 | day | on the 1st of the month |
| * | month | every month |
| * | weekday | any weekday |
The day-of-month field runs from 1 to 31. Using 1 runs on the 1st of every month. Cron has no built-in way to run on the last day of the month, since months have different lengths.
Last day of month workaround
# Run on 28th — safe for all months: 0 0 28 * * # Or: check if tomorrow is the 1st (run on last day): 0 23 * * * [ \"$(date -d tomorrow +%d)\" = \"01\" ] && /usr/local/bin/month-end.sh
Related Expressions
0 0 1 * *
1st of every month
0 0 15 * *
15th of every month
0 0 1 */3 *
1st of every quarter
0 0 1 1 *
January 1st every year
0 0 28 * *
28th of every month (safe last-week job)
Common Use Cases
- Monthly billing runs
- End-of-month reports
- Monthly archive jobs
- Subscription renewals
Paste your crontab to visualise every job on a 24-hour timeline — detect overlaps, collisions, and get flock-safe versions.
Open Cron Visualiser →Frequently Asked Questions
How do I run a cron job on the last day of the month?
Cron can't calculate the last day natively. The standard workaround is to check if tomorrow is the 1st: 0 23 * * * [ \"$(date -d tomorrow +%d)\" = \"01\" ] && /your/script.sh. On macOS use date -v+1d +%d instead.
What happens if I use 31 in the day-of-month field?
The job only runs in months that have 31 days (January, March, May, July, August, October, December). It silently skips months with fewer days — no error, just no execution.