Skip to content
Cron Expression Generator

Crontab format

Cron syntax cheat sheet

The cron expression format on one page: the five fields and their values, the four operators, special strings like @daily, and the rules that trip people up. Every example links to a full explanation.

The crontab format at a glance

A cron expression is five fields separated by spaces. In a crontab file, the command follows on the same line:

MIN  HOUR  DOM  MON  DOW   COMMAND
30   2     *    *    1-5   /usr/local/bin/backup.sh
│    │     │    │    │
│    │     │    │    └──── day of week: Monday to Friday
│    │     │    └───────── month: every month
│    │     └────────────── day of month: every day
│    └──────────────────── hour: 2 AM
└───────────────────────── minute: 30

Read it as “at 2:30 AM, Monday to Friday”.

#FieldAllowed valuesNotes
1Minute0–59—
2Hour0–2324-hour clock; midnight is 0, not 24
3Day of month1–31Days a month doesn't have are skipped
4Month1–12 or JAN–DECNames are not case-sensitive
5Day of week0–7 or SUN–SAT0 and 7 are both Sunday

Names are the first three letters of the English month or day. Numbers work in every cron implementation; some older documentation says ranges and lists of names (such as MON-FRI) aren't allowed, so 1-5 is the portable choice.

Cron operators

OperatorMeaningExampleRuns
*Every value* * * * *Every minute
,List0 9,17 * * *At 9 AM and 5 PM
-Range, both ends included0 9-17 * * *Every hour from 9 AM to 5 PM
/Step*/15 * * * *Every 15 minutes
a-b/nStep within a range0 8-18/2 * * *Every 2 hours from 8 AM to 6 PM

Operators combine: 0,30 9-17 * * 1-5 runs every half hour from 9 AM to 5:30 PM on weekdays.

Steps restart at the start of each range

*/7 in the minute field runs at 0, 7, 14 … 56 and then at 0 again, so the gap across the hour is 4 minutes, not 7. For an even rhythm, use a step that divides 60 for minutes (2, 3, 4, 5, 6, 10, 12, 15, 20, 30) or 24 for hours (2, 3, 4, 6, 8, 12).

For the same reason */90 does not mean every 90 minutes: depending on the implementation it is rejected or quietly treated as minute 0 only. To run a job every 90 minutes, use two lines:

0 0-21/3 * * *    /usr/local/bin/job.sh
30 1-22/3 * * *   /usr/local/bin/job.sh

Special strings

StringSame asRuns
@yearly @annually0 0 1 1 *Once a year, January 1 at midnight
@monthly0 0 1 * *On the 1st of every month at midnight
@weekly0 0 * * 0Every Sunday at midnight
@daily @midnight0 0 * * *Every day at midnight
@hourly0 * * * *At the start of every hour
@reboot—Once, when cron starts after a boot

Linux cron (Vixie cron and cronie) accepts all of them, and Kubernetes accepts all except @reboot. Other schedulers may not, so check before you rely on them.

Day of month and day of week: the OR rule

If both day fields are restricted, Unix cron runs the job when either one matches. 0 9 1 * 1 runs at 9 AM on the 1st of every month and on every Monday, not only on Mondays that fall on the 1st. If one of the two fields is *, only the other one counts.

To get AND logic, schedule the broader condition and test the other one in the command. The first Monday of the month, for example, is the Monday that falls on day 1 to 7:

0 9 * * 1  [ "$(date +\%d)" -le 7 ] && /usr/local/bin/monthly-report.sh

Quartz, AWS and Salesforce avoid the problem differently: they require ? in one of the two day fields.

Values that look right but aren't

Cron syntax on other platforms

Many schedulers borrow cron syntax and extend it. The extra symbols mean: ? no specific value, L last, W nearest weekday, # nth weekday of the month, and H a value Jenkins derives from the job name.

PlatformFieldsExtra symbols
Unix / Linux crontab5—
Quartz6–7? L W #
Spring6? L W #
AWS EventBridge6? L W #
Jenkins5H
Salesforce6–7? L W #
Hangfire5–6? L W #
Airflow5? L W #
node-cron5–6? L W #

Cron syntax examples

Browse all cron expression examples, or build your own with the cron expression generator.

Frequently asked questions

What is the correct cron syntax?

Five fields separated by spaces (minute, hour, day of month, month, day of week), followed by the command in a crontab: */10 * * * * /path/to/script.sh. Each field takes a number, *, a list (1,15), a range (1-5) or a step (*/10).

How many fields does a cron expression have?

Five in Unix cron. Quartz, Spring and Salesforce add a seconds field at the start (Quartz and Salesforce also allow an optional year at the end), and AWS EventBridge has six fields ending with a year.

What does the asterisk mean in cron?

“Every value.” * in the hour field means every hour, and * * * * * runs every minute.

Is cron syntax the same everywhere?

No. The five basic fields are widely shared, but Quartz and Salesforce count Sunday as 1, AWS needs a year field and ?, Jenkins adds H, and Hangfire and node-cron accept optional seconds. Use the generator for your platform to stay within its rules.

Can I use names like MON or JAN?

Yes, in the month and day-of-week fields: JAN–DEC and SUN–SAT, in any case. For ranges, numbers such as 1-5 are the most portable choice.

How do I run a cron job every 90 minutes?

A single expression can’t do it, because steps restart every hour. Use two lines, 0 0-21/3 * * * and 30 1-22/3 * * *, which together fire at 0:00, 1:30, 3:00, 4:30 and so on.

Does cron support seconds?

Not in Unix crontab, where the smallest unit is a minute. Schedulers such as Spring, Quartz and node-cron add a seconds field, so */30 * * * * * runs every 30 seconds there.

Related tools and guides