Cron expression for first day of the month

0 0 1 * * runs at 00:00 on the 1st of every month, twelve times a year.

Next runs (your time zone)

    This tool runs in your browser. We never send what you type or paste to a server.

    The expression

    0 0 1 * * /path/to/command

    The expression has five fields, read left to right:

    FieldValueMeaning here
    Minute0at minute 0
    Hour0at hour 0
    Day of month1on day 1
    Month*every month
    Day of week*every day of the week

    When it runs

    Starting from Wed 2027-01-06 10:07 UTC, the next runs are:

    Mon 2027-02-01 00:00
    Mon 2027-03-01 00:00
    Thu 2027-04-01 00:00
    Sat 2027-05-01 00:00
    Tue 2027-06-01 00:00

    Cron uses the time zone of the machine or service that runs it. The explainer at the top of this page shows the next runs in your own time zone.

    Variations

    0 0 1 * *          1st of every month, 00:00
    0 9 1 * *          1st of every month, 09:00
    0 0 1,15 * *       1st and 15th
    0 0 1 */3 *        1st of January, April, July and October (quarterly)
    0 0 1 1 *          1 January only; the same as @yearly
    @monthly           the same as 0 0 1 * *

    First Monday, or first working day

    It is tempting to write 0 0 1-7 * 1 for "the first Monday". It does not work: when both day fields are restricted, cron runs on days matching either, so that line fires on each of the first seven days and on every Monday. Keep one field as * and test the other in the command:

    # first Monday of the month: run on days 1-7, continue only on a Monday
    0 0 1-7 * *  [ "$(date +\%u)" = 1 ] && /path/to/command
    
    # first working day: the 1st if it is a weekday, otherwise the Monday that follows
    0 0 1-3 * *  [ "$(date +\%u)" -le 5 ] && { [ "$(date +\%d)" = 01 ] || [ "$(date +\%u)" = 1 ]; } && /path/to/command

    date +%u prints the weekday as 1 (Monday) to 7 (Sunday). Quartz and AWS can say it directly: 2#1 or MON#1 in the day-of-week field is the first Monday, and 1W in the day-of-month field is the nearest weekday to the 1st.

    Quartz adds a seconds field at the front, AWS adds a year at the end, and both need ? in one of the two day fields. See how the syntaxes differ.

    The same schedule in other schedulers

    SchedulerExpression
    Unix cron, crontab0 0 1 * * or @monthly
    Kubernetes CronJobschedule: "0 0 1 * *"
    GitHub Actions- cron: '0 0 1 * *'
    Quartz (Java, Spring)0 0 0 1 * ?
    AWS EventBridgecron(0 0 1 * ? *)

    Questions

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

    0 0 1 * *: midnight on day 1 of every month. @monthly is the same.

    How do I run a cron job on the first Monday of every month?

    Schedule it for days 1 to 7 and test for Monday in the command: 0 0 1-7 * * [ "$(date +\%u)" = 1 ] && command. Setting both day fields does not work, because cron treats them as either-or.

    How do I run a cron job every quarter?

    0 0 1 */3 * runs on the 1st of January, April, July and October. For other quarter starts list the months: 0 0 1 2,5,8,11 *.