plain/devtools home

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.

cron-explainersampless sample
Next runs in

FieldAllowed
minute0-59
hour0-23
day of month1-31
month1-12 or JAN-DEC
day of week0-7 or SUN-SAT (0 and 7 are Sunday)

never leaves your browser

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.sh

The 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.sh

Other platforms

  • Quartz supports L for the last day: 0 0 23 L * ?.
  • AWS EventBridge supports L too: 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 * 1 also 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

Related

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc