Complete Reference

Cron Syntax Guide

Everything you need to read, write, and debug cron expressions — from the basic Linux crontab format to advanced Kubernetes and AWS patterns.

2,500+ words All 5 fields explained Updated April 2026
Table of Contents
  1. What Is a Cron Job and How Does Crontab Work?
  2. The 5 Fields Explained (Crontab Format)
  3. Special Characters Reference
  4. Shorthand Notations (@daily, @weekly…)
  5. How to Read Any Cron Expression
  6. Most Common Cron Patterns
  7. AWS EventBridge Cron Syntax (6-field)
  8. Linux vs AWS: Key Differences
  9. Frequently Asked Questions

01. What Is a Cron Job and How Does Crontab Work?

A cron job is a scheduled task on Unix-like operating systems (Linux, macOS) that runs automatically at specified times. The name comes from Chronos, the Greek god of time. The program that manages these scheduled tasks is called the cron daemon (crond), and it reads scheduled tasks from a configuration file called a crontab (cron table).

Cron jobs are used for an enormous range of automated tasks: database backups, log rotation, sending scheduled emails, clearing caches, running reports, syncing data from APIs, and even defining the Kubernetes CronJob schedule syntax. If it needs to happen on a schedule, cron probably handles it.

A cron expression is the schedule string that tells cron when to run your task. Learning to write them correctly is a fundamental skill for anyone who works with servers, DevOps, or cloud platforms.

💡 Cron vs Crontab vs Cron Job
Cron = the daemon (background process). Crontab = the configuration file (or the crontab command). Cron job = a single scheduled task entry in the crontab. These terms are often used interchangeably in practice.

02. The 5 Fields Explained (Crontab Format)

Every standard cron expression contains exactly 5 fields, separated by spaces. Together, they define the complete crontab format explained schedule for when a command should run:

1
Minute
0 – 59
* , - /
2
Hour
0 – 23
* , - /
3
Day of Month
1 – 31
* , - / L W
4
Month
1–12 or JAN–DEC
* , - /
5
Day of Week
0–7 (0,7=Sun)
* , - / L #
# The 5-field structure:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 7, Sun=0 or 7)
│ │ │ │ │
* * * * *  command_to_execute

Field 1: Minute (0–59)

The minute field specifies which minute(s) of the hour the job should run. 0 means at the top of the hour (:00), 30 means at the half hour (:30), and * means every minute. You can also use */5 to mean every 5 minutes, or 15,45 to mean at :15 and :45.

Field 2: Hour (0–23)

The hour field uses 24-hour time. 0 = midnight, 9 = 9 AM, 13 = 1 PM, 23 = 11 PM. Use */2 for every 2 hours, 8-17 for business hours (8 AM to 5 PM), or * for every hour.

Field 3: Day of Month (1–31)

This field specifies which day(s) of the month to run. 1 = first day, 15 = 15th, L = last day of the month (not all implementations). Be careful with months that have fewer than 31 days — if you specify 31, the job won't run in February, April, June, September, or November.

Field 4: Month (1–12)

Specifies which month(s). You can use numbers (1–12) or 3-letter abbreviations (JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC). Use 1,4,7,10 for quarterly (Jan/Apr/Jul/Oct) or * for every month.

Field 5: Day of Week (0–7)

Specifies which day(s) of the week. Both 0 and 7 represent Sunday. You can use numbers or abbreviations: SUN, MON, TUE, WED, THU, FRI, SAT. Use 1-5 for Monday through Friday (weekdays), or 6,0 for Saturday and Sunday (weekends).

⚠ Day-of-Month vs Day-of-Week
When you specify both a day-of-month AND a day-of-week in standard Linux cron, the job runs when either condition is true (OR logic). For example, 0 9 1 * 1 runs on the 1st of every month AND every Monday. This is a common source of confusion — use one or the other when you want precise control.

03. Special Characters Reference

Cron expressions support several special characters beyond simple numbers. Understanding these unlocks the full expressive power of cron syntax.

*
Asterisk — Any Value
Matches any value in that field. The most common character in cron.
* in hours = every hour
* in days = every day of month
/
Slash — Step / Interval
Specifies a step value — run every N units. Always used after * or a range.
*/5 in minutes = every 5 min
0/2 in hours = every 2 hours from midnight
-
Hyphen — Range
Defines a range of values (inclusive on both ends).
9-17 in hours = 9 AM to 5 PM
1-5 in weekdays = Mon–Fri
,
Comma — List
Separates multiple specific values. Like an OR statement for values.
1,15 in days = 1st and 15th
MON,WED,FRI = three days
L
L — Last
In day-of-month: last day of the month. In day-of-week: last occurrence of that weekday in the month. Not supported in all cron implementations.
L in day-of-month = Jan 31, Feb 28/29...
5L = last Friday of the month
W
W — Nearest Weekday
Finds the nearest weekday (Mon–Fri) to the given day. Useful for business-day scheduling. Not universal.
15W = nearest weekday to the 15th
If 15th is Saturday, runs on Friday the 14th
#
# — Nth Weekday
Specifies the Nth occurrence of a weekday in a month. Only valid in day-of-week field.
1#1 = first Monday
5#3 = third Thursday
6#2 = second Saturday
?
? — No Specific Value
Used in AWS EventBridge (and some others) to mean "no specific value" — a placeholder when you've set the other day field. Not valid in standard Linux cron.
AWS: cron(0 9 ? * MON *)
? in day-of-month = don't care which day

04. Shorthand Notations

Many cron implementations support convenient shorthand strings that replace the entire 5-field expression. These are much more readable than the numeric format for common schedules.

@yearly
=
0 0 1 1 *
Once a year, Jan 1st midnight
@annually
=
0 0 1 1 *
Same as @yearly
@monthly
=
0 0 1 * *
Once a month, 1st day midnight
@weekly
=
0 0 * * 0
Once a week, Sunday midnight
@daily
=
0 0 * * *
Once a day, midnight
@midnight
=
0 0 * * *
Same as @daily
@hourly
=
0 * * * *
Once an hour, at :00
@reboot
special
Run once at system startup
ℹ️ Compatibility Note
Shorthand notations are supported in most modern Linux cron implementations (Vixie cron, cronie, fcron) but are not supported in AWS EventBridge or many embedded/minimal cron implementations. Always verify support for your specific environment.

05. How to Read Any Cron Expression

When you need to figure out how to read cron expression format for Linux and Kubernetes, use this simple reading framework. Parse each field from left to right, translating each value into plain English, then combine them:

# Example: 30 9 * * 1-5
30  = at minute :30
9   = at 9 AM (hour 9)
*   = any day of month
*   = any month
1-5 = Monday through Friday (days 1 to 5)

Result: Every weekday at 9:30 AM
# Example: 0 0 1,15 * *
0    = at minute :00
0    = at midnight (hour 0)
1,15 = on the 1st and 15th
*    = every month
*    = any day of week

Result: At midnight on the 1st and 15th of every month

06. Most Common Cron Patterns

These are the patterns you'll see and use most often in production systems. Memorize these and you'll be able to handle 90% of scheduling requirements.

ExpressionMeaningNotes
* * * * *Every minuteMost frequent possible schedule
*/5 * * * *Every 5 minutesHealth checks, polling
*/15 * * * *Every 15 minutesFrequent sync tasks
0 * * * *Every hour at :00Hourly aggregation
0 0 * * *Daily at midnightNightly jobs
0 2 * * *Daily at 2 AMDatabase backups (low traffic)
0 9 * * 1-5Weekdays at 9 AMBusiness day start
0 17 * * 5Friday at 5 PMEnd-of-week reports
0 0 1 * *Monthly, 1st at midnightMonthly billing jobs
0 0 * * 0Weekly on Sunday midnightWeekly maintenance
0 0 1 1 *Annually, Jan 1 midnightYearly archival
0 0 1 1,4,7,10 *Quarterly, 1st of quarterQ1/Q2/Q3/Q4 jobs

Need to Validate a Cron Expression String?

Paste any cron expression into CronRead and instantly get a human-readable description, the next 5 scheduled run times, and real-time validation.

Validate Your Cron Expression →

07. AWS EventBridge Cron Syntax (6-Field)

AWS EventBridge uses an extended cron syntax with 6 fields instead of 5. The extra field is Year, appended at the end. Additionally, AWS wraps the expression in a cron() function.

# AWS EventBridge format:
cron( Minutes  Hours  Day-of-month  Month  Day-of-week  Year )
      ────────────────────────────────────────────────────────
      0-59     0-23   1-31 or ?     1-12   1-7 or ?   1970-2199

# Example: Every weekday at 9 AM UTC
cron(0 9 ? * MON-FRI *)

The most critical rule: you cannot specify both Day-of-month and Day-of-week in the same expression. One of them must always be ?. AWS also uses a different day-of-week numbering: Sunday = 1, Monday = 2, ..., Saturday = 7.

08. Linux vs AWS: Key Differences

FeatureLinux CrontabAWS EventBridge
Fields56 (+ Year)
Syntax wrapperNonecron( )
Sunday number0 or 71
DOM + DOW togetherOR logic (both allowed)Not allowed — one must be ?
? characterNot usedRequired placeholder
Shorthand (@daily etc)SupportedNot supported

09. Frequently Asked Questions

What does * mean in a cron expression?
The asterisk (*) is a wildcard meaning "any value" for that field. So * in the hours field means "every hour", and * in the days field means "every day of the month". A cron expression with all asterisks (* * * * *) runs every single minute.
What does 0 0 * * * mean in crontab?
The expression 0 0 * * * translates to "run at minute 0, hour 0 (midnight), every day of the month, every month, every day of the week." It is the standard way to schedule a daily midnight job.
How to setup a Kubernetes CronJob schedule?
Kubernetes CronJob resources use the exact same 5-field crontab format as standard Linux. Inside your YAML file, under the spec block, you define the schedule key. For example, schedule: "0 0 * * *" will run the pod daily at midnight UTC.
Can cron jobs run every second?
No. The minimum interval for a standard cron job is 1 minute. Cron does not have a seconds field. If you need sub-minute scheduling, use a different tool (systemd timers with OnUnitActiveSec, Celery Beat, or an application-level scheduler).
How do I run a cron job every 5 minutes?
Use */5 * * * * in a Linux crontab. For AWS EventBridge, use cron(*/5 * * * ? *). This runs at :00, :05, :10, :15, :20, :25, :30, :35, :40, :45, :50, :55 past every hour, every day.
How do I validate a cron expression string before deploying?
You can manually parse the 5 fields, or use a tool like CronRead. Simply paste your string into our generator to instantly see the human-readable description and the next 5 execution times to ensure it matches your expected schedule.

🛠 Generate & Validate Cron Expressions Instantly

CronRead is a free cron expression generator that supports both Linux 5-field and AWS EventBridge 6-field syntax. Build visually, get human-readable previews, and validate before deploying.

Open CronRead — It's Free →

Further Reading

Now that you understand cron syntax, explore these related guides:

50+ Cron Job Examples (copy-paste ready) — real examples for every common scheduling pattern.

AWS EventBridge Cron Expression Guide — deep dive into the 6-field AWS format with 30 examples.

🔧 Other Free Developer Tools

⏱ Cron Generator 🕐 Timestamp Converter 🔑 JWT Decoder 📄 YAML ↔ JSON 🔤 Base64 Encoder 🗄 SQL Explainer