Cron every 2 months: 0 0 1 */2 * and the odd month set
0 0 1 */2 * runs on the first of every odd numbered month: January, March, May, July, September and November. Six runs a year.
At a glance
- Expression
- 0 0 1 */2 *
- Fires
- 6 times a year.
- Restricted fields
- Month stepped by 2, day of month pinned to 1, minute and hour pinned. Day of week open.
- Equivalent macro
- None.
- Months matched
- 1, 3, 5, 7, 9, 11. January, March, May, July, September, November.
- Even month equivalent
- 0 0 1 2/2 * matches February, April, June, August, October and December.
In detail
The month field runs from 1 to 12, so a step of 2 starts at January and lands on the odd numbered months. Twelve divides by two evenly, so there is no awkward gap at the end of the year: November is followed by January two months later, exactly like every other interval in the set.
Getting the even months requires the start at step form rather than a plain step, because there is no way to shift a bare asterisk. Writing 2/2 in the month field means start at February and step by two, which gives February, April, June, August, October and December. That form is the one to remember, because the same trick moves any stepped schedule off its default phase.
Month names work here too and are considerably easier to review. JAN,MAR,MAY,JUL,SEP,NOV is longer than */2 but nobody has to work out what it means, and the parser accepts the names in any case. For a schedule that fires six times a year, readability is worth more than brevity.
The day of month is pinned to 1 for the same reason it is in every other calendar schedule: it is the only date that exists in every month. Pinning to the 31st here would reduce a six run schedule to four, because September and November have no 31st.
Examples
0 0 1 */2 *0 0 1 2/2 *February, April, June, August, October, December.
0 0 1 JAN,MAR,MAY,JUL,SEP,NOV *Things that catch people out
- */2 in the month field starts at January because the field minimum is 1. It does not start from the current month.
- Pinning the day to anything above 28 loses runs. September and November have no 31st, and February has no 30th.
- Six runs a year means a failure is invisible for two months. Alert on the run, not on the output.
Try it: Cron Expression Parser
Paste any five or six field expression to get a plain English description, a per field breakdown and the next run times in your local time.
Cron Expression Parser
LOCAL · Browser-OnlyParse cron expressions and see the next scheduled run times
Supports 5-field (minute hour day month weekday), 6-field (with seconds), named values (JAN, MON), and @macros (@daily, @hourly, ...)
Use the dropdowns below to build your cron expression visually, or type a custom value in each field.
Human-Readable Description
Every 5 minutes
Field Breakdown
| Field | Allowed | Value | Meaning |
|---|---|---|---|
| Minute | 0-59 | */5 | every 5 minute(s) |
| Hour | 0-23 | * | every hour |
| Day of Month | 1-31 | * | every day of month |
| Month | 1-12 | * | every month |
| Day of Week | 0-7 | * | every day of week |
Related cron expressions
All cron expressions →Cron every quarter: 0 0 1 */3 *
0 0 1 */3 * runs on the 1st of January, April, July and October, four times a year. Shift it with 2/3 for a fiscal year starting in February.
Cron every 6 months: 0 0 1 */6 *
0 0 1 */6 * runs on the 1st of January and the 1st of July, twice a year. Any other pair of months needs a start at step or an explicit list.
The cron month field: 1 to 12 with JAN to DEC aliases
The month field runs 1 to 12 and also accepts the three letter names JAN through DEC, case insensitively, including inside ranges and steps.
Cron n/step: starting a step from a value you choose
The form 5/15 means start at 5 and step by 15, giving 5, 20, 35 and 50. It is how you move a repeating job off the crowded top of the hour.
Cron once a year: 0 0 1 1 * with @yearly and @annually
0 0 1 1 * runs at midnight on 1 January, once a year, and is what both @yearly and @annually expand to. Any date works, not just January.
Cron on 29 February: 0 0 29 2 * and the leap year rule
0 0 29 2 * runs only when 29 February exists, roughly once every four years. The century rule means 2100 has no leap day at all.
Tools for this
- Cron Expression Parser Free online cron expression parser - parse cron expressions and see the next scheduled run times
- Crontab Generator Free online crontab generator - build cron expressions visually with an intuitive interface