Run a cron job on the first of every month: 0 0 1 * * guide
0 0 1 * * runs a job at midnight on the first day of every month. The third field (1-31) controls the day of the month. This is the standard pattern for monthly billing runs, usage reports, and archival jobs that process the previous month's data.
How this is calculated
Not every month has 31 days. If you specify the 31st, the job simply won't run in February, April, June, September, or November. For the last day of the month, cron alone can't express it. The common workaround is to run on the 28th-31st and have the script check if tomorrow is the 1st. Alternatively, use 0 0 28-31 * * and let the script exit early if the date isn't the last day. Systemd timers handle this natively with OnCalendar=*-*-28..31 00:00:00 plus a script guard.
Verdict
0 0 1 * * is correct for first-of-month execution. For last-day-of-month scheduling, use a wrapper script or switch to systemd timers. If you need the 15th, 20th, or any day that exists in every month, the standard day-of-month field works without caveats.
More Cron scenarios
Frequently asked questions
What is a Cron Job?
What do the 5 parts of a cron expression mean?
What does the asterisk (*) mean in Cron?
How do I run a task every 5 minutes?
Related tools
Unix Timestamp
Convert between Unix timestamps and human-readable dates.
Use tool ➜CHMOD Configurator
Calculate Linux file permissions using checkboxes, octal numbers, or symbolic notation.
Use tool ➜Text Encoding Converter
Convert between Text, Base64, Binary, Hexadecimal, and Decimal formats.
Use tool ➜