The cron month field: 1 to 12 with JAN to DEC aliases
The month field accepts 1 through 12 and the three letter English abbreviations JAN through DEC. Names are case insensitive and work in ranges and lists.
At a glance
- Range
- 1 to 12, where 1 is January.
- Position
- Fourth of five fields, or fifth of six.
- Names accepted
- JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC.
- Case
- Insensitive. jan, Jan and JAN all resolve to 1.
- Field minimum
- 1, so */3 starts at January.
- Divisors of 12
- 1, 2, 3, 4 and 6 all step evenly across the year boundary.
In detail
The month field is the least used of the five, because most schedules repeat every month and leave it as an asterisk. When it does carry a value it is usually a quarterly or annual job, or a seasonal one that should only run for part of the year.
It accepts names as well as numbers, and the names are the three letter English abbreviations. The parser lowercases the token before looking it up, so any capitalisation works. Names can appear at either end of a range and anywhere in a list, so JAN-MAR, MAR,JUN,SEP,DEC and even JAN/3 are all valid.
The field minimum is 1, so a step counts from January. */3 gives January, April, July and October, and there is no way to shift that with the step alone. The start at step form does it: 2/3 gives February, May, August and November, which is the shape most fiscal quarter schedules need.
Because twelve is divisible by 2, 3, 4 and 6, all the common multi month steps wrap cleanly into the next year. A step of 5 does not: it gives January, June and November, and then jumps back to January two months later, the same boundary problem that a step of 5 has in the hour field.
Examples
0 0 1 1,4,7,10 *The first of January, April, July and October.
0 0 1 JAN,APR,JUL,OCT *0 6 * 6-8 * /opt/app/bin/summer-report.shDaily at 06:00 through June, July and August only.
Things that catch people out
- Month numbers start at 1, not 0. January is 1, unlike the zero based month numbering used in several programming languages.
- Only the three letter abbreviations are accepted. January and Jan. with a full stop are both rejected.
- A step of 5 or 7 does not wrap evenly into the next year, so the gap across December is shorter than the others.
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 name aliases: JAN to DEC and SUN to SAT
The month and day of week fields accept three letter English names, case insensitively, in single values, ranges, lists and steps.
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.
The cron day of month field: 1 to 31 and missing dates
The day of month field runs 1 to 31, and a date that does not exist in a given month simply never matches. Steps start at 1, giving odd days.
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.
The cron day of week field: 0 to 7 with Sunday at both ends
The day of week field runs 0 to 7 with Sunday as both 0 and 7, and accepts SUN through SAT. Restricting it changes how the day of month field behaves.
The cron seconds field: the optional sixth position
A six field expression puts seconds first and shifts everything right. The system crontab has no seconds field, so six fields there means a broken job.
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