What is a Cron Expression?
A cron expression is a string of five fields that defines a schedule for automated tasks in Unix-based systems. The expression 0 9 * * 1 means "every Monday at 9:00 AM".
Field Order
┌─────────── minute (0–59) │ ┌───────── hour (0–23) │ │ ┌─────── day of month (1–31) │ │ │ ┌───── month (1–12) │ │ │ │ ┌─── day of week (0–7, 0 and 7 = Sunday) │ │ │ │ │ * * * * *
Special Characters
*— every value (wildcard),— list of values:1,3,5-— range:1-5(Monday through Friday)/— step:*/15(every 15 units)
Common Patterns
* * * * *— every minute0 * * * *— every hour, on the hour0 0 * * *— every day at midnight0 9 * * 1-5— weekdays at 9:00 AM0 0 1 * *— first day of every month at midnight*/5 * * * *— every 5 minutes0 0 * * 0— every Sunday at midnight
Build and validate cron expressions visually: Open Cron Expression Generator →
Frequently Asked Questions
What does */5 mean in a cron expression?
The / character means "every N". In the minute field, */5 means every 5 minutes (0, 5, 10, 15, 20…).
What is the difference between cron and crontab?
Cron is the background daemon that runs scheduled tasks. Crontab is the file where those tasks are defined. Edit it with crontab -e in a terminal.