tooloora

Cron monthly on the 1st — 0 0 1 * * explained

One run a month at midnight on the 1st — identical to @monthly, and why the last day of a month is the hard case.

Runs locally — nothing is uploaded

Examples

In plain words

At 00:00, on the 1st day of the month.

Field by field

  • 0Minute

    at minute 0

    Matches: 0

  • 0Hour

    between 00:00 and 00:59

    Matches: 0

  • 1Day of month

    on the 1st day of the month

    Matches: 1

  • *Month

    in every month

    Matches: Jan, Feb, Mar, Apr, May, Jun … Dec

  • *Day of week

    on every weekday

    Matches: Sun, Mon, Tue, Wed, Thu, Fri, Sat

Next runs

Calculating the next runs …

These times apply in the time zone configured on the server. Cron converts nothing; this preview uses your device clock.

The expression stays in your browser — it is never sent to a server.

Other expressions

0 0 1 * * runs the job once a month, at 0:00 on the 1st. The third field pins the day of the month, month and weekday stay open, so the run happens twelve times a year regardless of which weekday the 1st falls on. The shortcut @monthly expands to exactly this line.

How do I run a job on the last day of the month?

Not with the day field alone: 0 0 31 * * skips every month that has 30 days, and February entirely. The standard trick is to run daily and let the script decide: 0 23 28-31 * * combined with a test like [ "$(date -d tomorrow +%d)" = "01" ] fires only on the actual last day, whatever its number.

What happens if I add a weekday to a monthly job?

It becomes far more frequent than intended. 0 0 1 * 1 does not mean “the 1st, if it is a Monday” — with both day fields restricted, cron links them with OR, so the job runs on the 1st and on every Monday, roughly five times a month. Friday the 13th simply cannot be expressed in cron; it needs a date check inside the script.

Is the 1st a good day for monthly billing runs?

It is the obvious choice and therefore the busiest: invoices, reports, quota resets and licence checks all cluster there, both on your machine and at every service you call. If the run depends on data that is only complete during the night, the 2nd at 4 a.m. is often the calmer and more reliable slot — cron has no retry, so a failed run waits a full month.

How to add the expression

  1. Put the day in the third field and leave the weekday field as a star, otherwise the OR rule doubles the schedule.
  2. Add 0 0 1 * * plus the command, or @monthly when the date is fixed for good.
  3. For the last day of a month, schedule 28-31 and check inside the script whether tomorrow is the 1st.
  4. Alert on failure: a monthly job that silently fails is only noticed in the next quarter.

Frequently asked questions

Is 0 0 1 * * the same as @monthly?

Yes, the shortcut expands to exactly these five fields. Both run at midnight on the 1st of every month, twelve times a year, on whichever weekday that happens to be.

How do I run a job every quarter?

Restrict the month field: 0 0 1 1,4,7,10 * runs on the 1st of January, April, July and October. The step form 0 0 1 */3 * produces the same four months, starting from January.

Why does my job on the 31st skip some months?

Because those months have no 31st. Cron matches a real calendar date, so a job pinned to the 31st runs seven times a year. Schedule 28-31 with a check in the script if you mean the last day.

Do the next run times leave my browser?

No. The expression is parsed and the dates are computed locally on your device; nothing is uploaded, and no server ever sees which schedule you are working on.