Cron Expression Syntax Explained (With Examples)

Cron syntax looks cryptic until you learn to read it field by field. Once you can decompose a schedule into minutes, hours, days, months, and weekdays, the expression practically reads itself. This guide decodes each part and shows the special characters that give cron its power.

What are the five fields of a cron expression?

A cron expression has five fields: minute, hour, day of month, month, and day of week. 30 2 * * * means "at 2:30 every day": the minute is 30, the hour is 2, and the three * fields match every day, every month, and every weekday.

What does an asterisk mean in cron?

A * in a field matches every possible value, which is the most common starting point. 0 * * * * runs "at minute 0 of every hour." You will usually fix the low-frequency fields to * and only restrict what matters.

What do ranges, lists, and increments do in cron?

A range like 9-18 matches every hour in that span. A list like 1,15 matches only those values. An increment like */15 matches every 15th unit. Together they let you express most schedules without brute force.

How do you read a cron expression?

0 9 * * 1 runs "at 9:00 every Monday." */5 * * * * runs "every 5 minutes." 0 0 1 * * runs "at midnight on the first day of each month." Notice how each field fixes only what the schedule actually cares about.

How do you get the schedule right the first time?

Because a single misplaced digit changes every run, use a generator that explains the schedule back to you in plain language. Build and preview expressions with the cron generator, which renders a human-readable description instantly.

FAQ

Related Articles