Cron on the first day of the month: the expression
0 0 1 * *
The 1 in the day-of-month field fixes the day, and the 0 0 fix the time at midnight, so the job runs once a month, at the start of the first day. The shortcut @monthly means exactly this. Because months have different lengths, the first day is the one safe day that exists in every month.
This page opens the crontab generator with the expression loaded: it describes it in plain words, checks every field and lists the next runs in the time zone you choose. Read by the tool: "At 00:00, on day 1 of the month".
Field by field
| Field | Allowed values | Here |
|---|---|---|
| minute | 0-59 | 0 |
| hour | 0-23 | 0 |
| day of month | 1-31 | 1 |
| month | 1-12 | * |
| day of week | 0-7 (0 and 7 = Sunday) | * |
Minute 0, hour 0, day of month 1, month * (every month), weekday *.
The next runs
Counted from Mon, Jan 5, 2026, 08:07:00 (UTC), the first five runs are:
- Sun, Feb 1, 2026, 00:00:00
- Sun, Mar 1, 2026, 00:00:00
- Wed, Apr 1, 2026, 00:00:00
- Fri, May 1, 2026, 00:00:00
- Mon, Jun 1, 2026, 00:00:00
In a crontab
crontab -e
0 0 1 * * /usr/local/bin/close-month.sh >> /var/log/close-month.log 2>&1
crontab -l # lists what is installedThe same schedule in other systems
| System | Expression |
|---|---|
| Linux cron, Kubernetes CronJob, GitHub Actions (5 fields) | 0 0 1 * * |
| Quartz and Spring (6 fields, with seconds) | 0 0 0 1 * ? |
| AWS EventBridge (6 fields, with year) | cron(0 0 1 * ? *) |
The tool reads the three forms and produces exactly the same runs for them; the page checks that while it is built. The last day of the month exists only in Quartz and AWS EventBridge: 0 0 0 L * ? and 0 0 L * ? *. In standard cron, a common substitute is to run daily and test tomorrow's date in the script: [ "$(date -d tomorrow +\%d)" = "01" ].
What it is used for
- Monthly billing runs, subscription renewals and invoice generation.
- Closing the previous month: reports, reconciliations and archiving of old data.
- Resetting monthly quotas, such as API calls or storage allowances.
Common mistakes
- Scheduling "the 31st": months with 30 days (and February) have no day 31, so the job is skipped in those months. For the last day use Quartz or AWS EventBridge (L), or schedule the 1st and compute the previous month in the script.
- Running a report for "this month" at 00:00 on the 1st: the month has just begun and is empty. Report on the previous month, and remember that its last day may still have late data.
How to use the generator
- The expression is already in the box; edit any field, or toggle values in the field editor.
- Choose the style (Linux, with seconds, Quartz or AWS) and the time zone, and see the next 5, 10 or 20 runs.
- Copy the expression into your crontab, your workflow file or your EventBridge rule.
Frequently asked questions
What is the cron expression for the first day of every month?
0 0 1 * *, or @monthly. For 08:30 on the 1st use 30 8 1 * *.
How do I run every 3 months (quarterly)?
List the months: 0 0 1 1,4,7,10 * runs on January, April, July and October 1st. */3 in the month field gives 1, 4, 7, 10 too.
What if the server is off at midnight on the 1st?
Standard cron does not catch up on missed runs. Use anacron (it runs missed daily, weekly and monthly jobs after boot) or a systemd timer with Persistent=true.