Running “0 0 1 * *” in production
Month-start jobs: billing, closeouts, and retention
0 0 1 * * fires at midnight on the first of every month, and its workload is the calendar-driven core of the business: billing runs and invoice generation, subscription renewals and quota resets, monthly report snapshots (the 1st is the natural 'as of' boundary), data-warehouse partition rotation, and retention enforcement that deletes the month of data now past its window. Month-start differs from every other cadence in one structural way: the interval between fires is 28, 29, 30, or 31 days — variable — which breaks every naive 'days since last run' calculation a job might do.
February is the stress test. A job assuming 30-day months drifts every month; a billing job that prorates on 'days in period' must ask the calendar how long the period actually was (28 in common years, 29 in leap years, and leap-year logic itself is a known bug farm). The 1st also collides with the weekend problem: a month starting Saturday means billing and reports land in empty inboxes, which is why many teams schedule the business action for the 1st but deliver notifications on the first business day — a policy the job implements, not the cron line.
Month-start across schedulers — and the last-day problem
Every platform expresses the first of the month directly: 0 0 1 * * in cron and Kubernetes; cron(0 0 1 * ? *) in EventBridge; OnCalendar=*-*-01 00:00:00 in systemd; crontab(day_of_month='1') in Celery. The interesting sibling problem is the LAST day of the month, which five-field cron cannot express (there is no 31st in every month) — Unix workarounds use the 28-31 guard-day pattern (see this directory's month-end-guard recipe), while Quartz, EventBridge, and CloudWatch scheduled expressions all have a native L modifier. If your job is really a month-end job, the L-bearing dialects are the honest answer.
Month-start jobs are also the natural home of the idempotency discipline: they run rarely, touch money, and will inevitably be re-run manually after a bad deploy. The reliable pattern is a run ledger — one row per (job, month) with status — written before work begins, so a re-run resumes or refuses cleanly instead of double-billing. Cron guarantees the schedule; only the job can guarantee the semantics, and monthly is the cadence where that distinction pays rent.
Common questions
How do I run a cron job on the last day of every month?
Standard five-field cron cannot — day-of-month 31 does not exist in every month, and there is no 'last day' token. The Unix workaround is the guard-day pattern: schedule on days 28-31 (0 0 28-31 * *) and have the job check whether tomorrow is the 1st, exiting early if not — see this directory's month-end-guard recipe for the exact form. Quartz and AWS EventBridge support a native L: 0 0 L * ? in Quartz fires on the last day directly, making them the cleaner answer when the dialect is yours to choose.
Does 0 0 1 * * run at midnight or at 1 AM?
Midnight at the start of the 1st: minute 0, hour 0, day-of-month 1 — 00:00 on the first of each month. The day field here is day-of-MONTH (1-31), not day-of-week; the two day fields occupy positions 3 and 5 respectively, and mixing them up turns a monthly job into a weekly one (0 0 * * 1 is Monday). The field table above labels each position explicitly, and the simulator's next-run list confirms you are looking at monthly fires.