Skip to content

Cron on the First Day of the Month

The first of every month is 1 in the day-of-month field. At midnight it is exactly @monthly.

minute · hour · day · month · weekday

Build it with controlsMonthly on the 1st
Day of the month

In plain English

At midnight on the 1st of every month.

Tap a field to see what it means.

A week0 runs
Mon–Tue–Wed–Thu–Fri–Sat–Sun–
Next run
—
Usually every
—
Time zone
Yours
Convert to another schedulerQuartz, Spring, AWS, GitHub Actions, Kubernetes
The same schedule in every dialect
Standard cron0 0 1 * *current
Quartz0 0 0 1 * ?
Spring0 0 0 1 * *
AWS EventBridgecron(0 0 1 * ? *)
GitHub Actions0 0 1 * *
Kubernetes0 0 1 * *
About Standard cronTime zone, day numbering, daylight saving
  • Runs in the machine’s local time zone; cronie also reads CRON_TZ at the top of the crontab.
  • Five fields, then the command. Day of week is 0–7 (0 and 7 are Sunday) or SUN–SAT; months 1–12 or JAN–DEC.
  • When both day fields are set, a day that matches either one runs.
  • Daylight saving: a job at a fixed time in a skipped hour runs right after the change, and one in a repeated hour runs once. Jobs with * in the minute or hour follow the clock.

Sources: crontab(5), cronie, cron(8), cronie, POSIX crontab.

How this works: Method, 10 sources, Checked against 1 worked example,

How this works

Method

The expression is read field by field with the rules of the scheduler you pick (ranges, lists, steps, names, @ macros, and L, W and # where it has them) into the values each field allows. The next runs come from stepping forward through the calendar in the chosen time zone, day by day and then time by time, using that scheduler’s rule for when both day fields are set and its documented rule for daylight saving (where it has none, a skipped time is skipped and a repeated one runs once). A conversion to another scheduler is parsed back and checked against the original before it is shown.

How it’s tested

One worked example for this page is checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • First version: plain English and the next runs for six schedulers, a builder, conversion between them, and 20 pages for common schedules.

How we make toolsReport a mistake

Worked example: 0 0 1 * *

Say the clock reads Monday 4 January 2027, 12:00 AM UTC. 0 0 1 * * means “at midnight on the 1st of every month”, so the next five runs are Monday 1 February 2027, 12:00 AM, Monday 1 March 2027, 12:00 AM, Thursday 1 April 2027, 12:00 AM, Saturday 1 May 2027, 12:00 AM and Tuesday 1 June 2027, 12:00 AM.

In UTC, where no clock change interrupts it, that comes to 12 runs in 2027.

The 1st of every month

The third field is the day of the month. 1 there, with a time in front and stars after it, runs once a month: 0 0 1 * * at midnight on the 1st, twelve times a year.

@monthly means exactly 0 0 1 * * in Linux cron, Kubernetes and Spring. For a later time on the 1st, write it out: 0 6 1 * * runs at 6:00 AM.

Every month has a 1st, so this never skips. Days 29 to 31 are different: 0 0 31 * * runs only in the seven months that have a 31st.

Pitfalls

  • Adding a weekday makes it run more, not less: 0 0 1 * 1 in Linux cron runs on the 1st and on every Monday, because both day fields are set.
  • For the first working day, there is no cron syntax except Quartz’s 1W (the weekday nearest the 1st, never in the previous month).
  • A UTC midnight on the 1st is still the last day of the previous month in the Americas.
  • @monthly runs once a month, i.e. “0 0 1 * *”. Source: crontab(5), cronie.
  • When both day fields are restricted, the command runs when either matches: “30 4 1,15 * 5” runs at 4:30 am on the 1st and 15th of each month, plus every Friday. Source: crontab(5), cronie.

“First Day of the Month” in every scheduler

The same schedule written for each scheduler, converted and checked by this tool. A dash means that scheduler can’t express it in one expression; the note says why.

The same schedule written for each scheduler, converted and checked by this tool. A dash means that scheduler can’t express it in one expression; the note says why.
SchedulerExpressionNote
Standard Unix cron (Vixie cron, cronie)0 0 1 * *
Quartz Scheduler (Java)0 0 0 1 * ?
Spring Framework @Scheduled0 0 0 1 * *
Amazon EventBridge cron()cron(0 0 1 * ? *)
GitHub Actions schedule0 0 1 * *
Kubernetes CronJob0 0 1 * *

Frequently Asked Questions

What is the cron for the first of the month?

0 0 1 * * runs at midnight on the 1st. @monthly is the same in Linux cron, Kubernetes and Spring.

How do I run on the first weekday of the month?

In Quartz or Spring, use 1W in the day-of-month field: 0 0 9 1W * ?. In Linux cron, run on days 1 to 3 and test in the command whether it is the first weekday.

How do I run on the 1st and 15th?

List both days: 0 0 1,15 * *.