Cron Symbols Explained: Asterisk, Slash, Dash, and Comma

A cron line is five fields and a command. The fields look cryptic until you notice that almost every schedule is written with just four symbols. Learn those four and a crontab stops being a wall of punctuation.

The template is always the same:

MINUTE HOUR DAY-OF-MONTH MONTH DAY-OF-WEEK command

* — every value in the field

An asterisk means “all values this field can hold”. In the minute field it means every minute. In the hour field it means all twenty-four hours. That is why a line of five asterisks runs a job every minute of every day — sixty times an hour, 1,440 times a day.

The most common misreading is to think * means “any one value, choose once”. It does not. * in the hour field does not pick one hour; it fires in all of them.

, — a list

A comma joins separate values. This is the symbol that makes a schedule read like a sentence:

0 9,13,18 * * * /usr/local/bin/check-inbox.sh

That runs at 09:00, 13:00 and 18:00. Lists also accept names in the month and weekday fields, so 0 9 * * mon,wed,fri is valid and easier to review than 1,3,5.

Two rules keep lists honest: no spaces around the comma, and every item must be a value the field accepts. 0 9 * * mon,1 mixes a name and a number — some implementations take it, others reject the line, so pick one style.

- — a range

A dash means “from here to there, inclusive”. 9-17 in the hour field is 9, 10, 11, 12, 13, 14, 15, 16 and 17 — nine values, not eight. The range includes both ends.

Weekday ranges trip people up because the numbering is not what they expect. In the cron most Linux distributions ship, 0 is Sunday and 6 is Saturday, so 1-5 is Monday to Friday. Some systems also accept 7 as a second name for Sunday. If a weekday schedule matters, write the names: mon-fri is unambiguous.

A reversed range such as 17-9 is not a wrap-around. It is invalid, and the job will not run at all.

/ — a step

A slash means “every Nth value”. */15 in the minute field gives 00, 15, 30 and 45. Written with a range, 10-50/20 gives 10, 30 and 50.

The step starts from the first value of the field, not from the moment you saved the file. */5 in minutes always lands on :00, :05, :10 — never on :02 because you happened to edit the crontab at 14:02.

There is a second detail that surprises people: a step does not divide evenly into the field unless the field length is a multiple of it. */7 in minutes produces 0, 7, 14, 21, 28, 35, 42, 49 and 56, and then the next run is 0 again — a four-minute gap at the top of the hour. “Every seven minutes” is not a schedule cron can keep evenly. If the interval matters, pick a divisor of 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30.

A step with a bare number is accepted by Vixie cron, the implementation behind most Linux systems: 5/10 expands to 5-59/10, meaning 5, 15, 25, 35, 45 and 55. Not every cron does this — BusyBox and some embedded versions reject it. Write the full range (5-59/10) when you want the line to travel.

The two-field trap

This one deserves its own section because it silently does the wrong thing.

When both the day-of-month field and the day-of-week field are restricted — neither is * — cron runs the job when either field matches, not when both do.

0 0 13 * 5 /usr/local/bin/friday-report.sh

Almost everyone reads that as “Friday the 13th”. It is not. It runs on the 13th of every month, and on every Friday — five or six runs a month instead of one.

If you genuinely need both conditions, put the second check inside the command:

0 0 13 * * [ "$(date +\%u)" = "5" ] && /usr/local/bin/friday-report.sh

The \% matters: a percent sign in a crontab line starts a newline in the command, so it has to be escaped.

The safe habit is simple. Restrict one day field, leave the other as *, and move the second condition into the script.

What the symbols cannot do

Four symbols cover a lot, but they do not cover everything people ask for:

  • No “last day of the month”. 31 skips February, April, June, September and November.
  • No “every 90 minutes”. The minute field resets at the top of each hour.
  • No seconds. Five fields means one-minute resolution. Six-field lines with a seconds column belong to Quartz, Spring and some Node schedulers, not to a system crontab.
  • No “run once, at a specific date”. That is at, not cron.

Read the line back before you save it

The fastest way to catch a wrong symbol is to read the expression in plain language and compare it with what you meant. The cron expression parser does exactly that: it breaks the line field by field and names the values each symbol produces. The cheat sheet holds the reference table, and the common mistakes page covers the traps that survive a correct-looking line — missing PATH, lost output, jobs that start twice.

If you want the reading habit rather than the symbols, start with how to read any cron expression in plain English. Symbols are the alphabet; that post is the grammar.