Cron on the first day of the month
Use 0 0 1 * *. It runs at 00:00 on day 1 of every month. The shortcut @monthly means the same in Vixie style cron.
Last reviewed 2026-11-04.
| Field | Allowed |
|---|---|
| minute | 0-59 |
| hour | 0-23 |
| day of month | 1-31 |
| month | 1-12 or JAN-DEC |
| day of week | 0-7 or SUN-SAT (0 and 7 are Sunday) |
Worked example
A monthly invoice job at 06:30 on the 1st: minute 30, hour 6, day of month 1, any month, any weekday.
$ 30 6 1 * * /home/deploy/bin/monthly-invoices.shThe last day of the month
Standard cron has no "last day" value. A common workaround runs on days 28 to 31 and lets the script exit unless tomorrow is the 1st. In a crontab the percent sign must be escaped:
$ 0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /home/deploy/bin/month-end.shOther platforms
- Quartz supports
Lfor the last day:0 0 23 L * ?. - AWS EventBridge supports
Ltoo:cron(0 23 L * ? *). - GitHub Actions and Kubernetes use the five field form, so use the 28 to 31 workaround there.
Common mistakes
- Using day 31 for month end. Months with fewer than 31 days never match it.
- Setting a day of week as well. If both day fields are restricted, Unix cron runs on either, so
0 0 1 * 1also runs every Monday. - Forgetting the time zone, which decides which calendar day it is when the job fires.
Running this on a server
A monthly job is easy to forget about, so run it on a machine you keep patched and watched. A small VPS is a common choice; the hosting guide compares them with static hosts.
Frequently asked questions
What does @monthly do?
In Vixie style cron it is shorthand for 0 0 1 * *: once a month at midnight on the first day.
Does it run in short months?
Yes. Day 1 exists in every month, so it runs every month.
How do I run on the 15th as well?
List the days: 0 0 1,15 * * runs on the 1st and the 15th of every month.
Sources
- crontab(5) manual page checked 2026-11-04
- AWS EventBridge: Schedule expressions for rules checked 2026-11-04