Cron expression generator · on the first day of every month

Cron job on the first day of every month

The crontab line for a job on the first day of every month is 0 0 1 * *. It runs 12 times a year. Edit it below to see the next runs in your time zone.

—

Next runs

    Field by field

    How 0 0 1 * * reads

    The five fields are minute, hour, day of month, month and day of week. A star means every value.

    FieldValueMeaning
    Minute0minute 00
    Hour0hour 00
    Day of month1the 1st of the month
    Month*every month
    Day of week*every day of week

    For example, from Wednesday 6 January 2027 at 10:07 the next runs are: Mon 1 Feb 2027, 00:00; Mon 1 Mar 2027, 00:00; Thu 1 Apr 2027, 00:00; Sat 1 May 2027, 00:00; Tue 1 Jun 2027, 00:00.

    When to use it

    What a job on the first day of every month is for

    The 1st of the month is when monthly work happens: invoices, usage reports, archiving last month’s logs, and resetting monthly quotas.

    Mistakes

    Common mistakes

    • «0 0 1 * 1» is not «the first Monday»: it runs on the 1st and on every Monday. For the first Monday, run on days 1 to 7 and check the weekday in the command: «0 0 1-7 * * [ "$(date +\%u)" = 1 ] && command».
    • Standard cron cannot say «the last day of the month». Run on days 28 to 31 and check whether tomorrow is the 1st: «0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && command» (GNU date).
    systemd

    The same schedule as a systemd timer

    On systems with systemd, a timer can replace the crontab line: OnCalendar=monthly. Check it with systemd-analyze calendar "monthly", which prints the next run.

    Monitoring

    Know when it didn’t run

    Cron doesn’t tell you when a job stops running. Heartbeat monitors watch for the job’s ping, with periods from a minute to a week, so a monthly job is longer than they can cover today. For a monthly job, have it report failures instead: a call to the heartbeat URL with /fail alerts you at once.

    What is the cron expression for a job on the first day of every month?

    0 0 1 * *. It runs 12 times a year, on the server’s clock.

    How do I run a job on the first day of every month with systemd instead?

    Create a timer with OnCalendar=monthly next to a service that runs the job, then enable it with systemctl enable --now name.timer. Persistent=true also runs a run that was missed while the machine was off.