Cron example
Cron First Day of the Month
Midnight on the first of every month: twelve runs a year, and the safest monthly schedule there is. Days 29, 30 and 31 do not exist in every month, but the 1st always does — which is why billing runs, retention sweeps and monthly reports overwhelmingly live here rather than at the end of the month.
By NaveenKumar T · Updated · 5-field crontab expression
What each field means
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | Minute 0 |
| Hour | 0 | Hour 0 |
| Day of month | 1 | Day 1 |
| Month | * | Every month |
| Day of week | * | Every day of the week |
Next 5 run times
Computing the next runs in your timezone…
The 1st is the only universally safe date
Pin the day-of-month field to 31 and the job runs seven times a year. Pin it to 30 and it skips February. Pin it to 29 and February only participates in leap years. The 1st through the 28th are safe in every month, and of those the 1st is the one that maps cleanly onto the idea of a monthly cycle.
That is why month-end work is almost always written as month-start work on the following month. A report covering September is generated at 00:00 on 1 October, computing its own date range from the clock rather than assuming which day it ran. That reframing removes the entire class of calendar bugs described on the last day of the month page.
Never add a day-of-week restriction here
This is the most dangerous interaction in cron. When both the day-of-month and day-of-week fields are restricted, classic cron runs the job when either one matches, not both. So 0 0 1 * 1 does not mean the 1st when it falls on a Monday — it means the 1st of every month and every Monday, which is roughly five times more runs than intended.
Keep the day-of-week field as an asterisk in any day-of-month schedule. If you truly need the first Monday of the month, use a day-of-week schedule with a date guard: run 0 0 * * 1 and have the command exit unless the day of month is 7 or lower. That guard is the only reliable way to express nth-weekday rules in standard cron.
Monthly variants
For quarterly work, add a step or a list to the month field — that is the difference between this schedule and every 3 months or calendar quarters. For an annual run, pin the month to a single value, as January 1 does.
For twice-monthly, list two safe dates: 0 0 1,15 * *. And shift the hour off midnight if the 1st matters commercially — 0 0 1 * * on a billing system collides with every other billing system on the internet, so 0 3 1 * * will finish sooner.
Build a variant of this schedule with dropdowns and check the next ten runs before you install it.
Open the cron generatorRelated cron examples
Browse every schedule on the cron expression generator, read the cron expression syntax guide for the rules behind the five fields, or the developer tools guides for the longer explanations.