Cron expression
Cron expression for first of the month
0 0 1 * *At 00:00, on day 1 of the month.
How it works
Midnight on day 1 of every month. @monthly is the same schedule.
There's no standard way to say "the last day of the month" in 5-field cron (L is a Quartz extension). The usual trick is to run on days 28 to 31 and check in the script whether tomorrow is the 1st: [ "$(date -d tomorrow +%d)" = 01 ] && ./job.sh (GNU date).
Careful when setting both day of month and day of week: 0 0 1 * 1 runs on the 1st AND on every Monday, not only on Mondays that fall on the 1st.
Variations
| Expression | Runs |
|---|---|
0 6 1 * * | The 1st of every month at 06:00 |
0 0 1 */3 * | The 1st of every third month (quarterly) |
0 0 1 1 * | Once a year, on January 1st |
Try it and see the next runs
At 00:00, on day 1 of the month
0
Minute
0
Hour
1
Day of month
*
Month
*
Day of week
Next runs
Working out the next runs…
Build one
Common schedules
Know when the job doesn't run
Cron fails quietly: if the server is down, the crontab was overwritten or the script exits early, nothing tells you. A heartbeat monitor flips it around: the job pings a URL each time it succeeds, and you're alerted when the ping doesn't arrive in time.
0 0 1 * * /usr/local/bin/job.sh && curl -fsS -m 10 --retry 3 https://uptenna.com/hb/<token>With an Uptenna heartbeat you set how often the job should run and a grace period. If the ping is late, an incident opens and you get an alert; ping /hb/<token>/fail to report a failure straight away. Email alerts are free; read how to monitor cron jobs for the details.
Frequently asked questions
What is the cron expression for first of the month?
0 0 1 * *. In plain English: at 00:00, on day 1 of the month.
Will it run if the server was off at that time?
No. Standard cron doesn't catch up on missed runs; the next run is simply the next matching time. Tools like anacron or systemd timers with Persistent=true can run missed jobs after a reboot.
How do I know the job actually ran?
Have the job ping a heartbeat URL when it finishes. If the ping doesn't arrive on schedule, a monitor such as an Uptenna heartbeat alerts you.
Common cron schedules
Get told when a cron job doesn't run
Uptime checks, cron job heartbeats and a public status page, with an alert the moment something breaks.
- No card required
- 14-day Pro trial
- Free plan after
- Monitors
- Free: 5Pro: 50
- Check every
- Free: 5 minPro: 1 min
- Alerts
- Free: EmailPro: 5 channels
- Status pages
- Free: 1Pro: 5
- SSL expiry alerts
- Free: Pro: