The wildcard: *

* means “every value this field can take”. In the minute field it means 0 through 59; in the month field it means January through December. It is the default you see in every five-field expression and the reason * * * * * runs every minute.

A wildcard still interacts with the rest of the expression. 0 * * * * is not “every minute”; the minute field is fixed to 0, so it runs once per hour at minute 0.

The step: / and */n

*/n means “every nth value, starting at the field minimum”. In minutes, */15 matches 0, 15, 30 and 45. In hours, */6 matches 0, 6, 12 and 18. The step does not depend on when the job was saved.

start/n means “every nth value starting at start”. 5/10 in minutes matches 5, 15, 25, 35, 45 and 55 — useful when you want to avoid the top of the hour. Mixing a range with a step, 10-40/10, limits the repetitions to that window.

*/5 and 0-59/5 are equivalent. Some older BusyBox builds only accept one form; prefer */5 for readability.

Ranges and lists: - and ,

A range is inclusive: 1-5 includes both endpoints. In the weekday field, 1-5 is Monday through Friday. In the hour field, 9-17 is 09:00 through 17:59 — the end hour is included, which surprises people who expect it to stop at 17:00.

A list is a union: 1,15,30 in day-of-month runs on the 1st, 15th and 30th. Lists can contain ranges and steps, so 0,15-30/5,45 is valid but hard to read. Prefer separate lines when a list becomes complex.

Quartz-only characters: ? L W #

These four characters are not part of standard Unix cron. They exist in Quartz, Spring's cron support, and some enterprise schedulers. Putting them in a crontab will usually cause the line to be rejected, or silently never run.

  • ? — “no specific value”, used in exactly one of day-of-month or day-of-week.
  • L — last day of the month, or last occurrence of a weekday with a prefix (6L = last Friday).
  • W — nearest weekday to a given date (15W), never crossing into another month.
  • # — nth weekday (MON#2 = second Monday; 5#3 = third Friday).

Special cases that behave unlike operators

@reboot is not an expression at all; it asks the daemon to run the command once when it starts. It is unsupported in some minimal containers and does not run if the daemon never starts.

~ (random range) appears in newer cronie versions and picks a random value in a range, which is useful for spreading load. It is an extension, not portable, and should be documented next to the job if used.

If a character works on your laptop but not in production, compare the cron implementation first: cronie, Vixie cron, BusyBox and Quartz all accept slightly different dialects.

Combining characters safely

cron
*/15 * * * *          # every 15 minutes
0 9-17/2 * * 1-5     # every 2 hours from 9:00 to 17:00 on weekdays
0 0 1,15 * *         # 1st and 15th of each month
0 0 L * *             # Quartz only: last day of month
0 0 15W * *           # Quartz only: nearest weekday to the 15th