Cron in 60 Seconds
Cron is a time-based job scheduler in Unix/Linux. A cron expression defines when a task should run using five fields:
minute hour day-of-month month day-of-week
The Five Fields
- Minute: 0-59
- Hour: 0-23
- Day of Month: 1-31
- Month: 1-12 (or JAN-DEC)
- Day of Week: 0-7 (0 and 7 = Sunday, or SUN-SAT)
Special Characters
*— Any value (wildcard),— List:1,3,5(Monday, Wednesday, Friday)-— Range:1-5(Monday through Friday)/— Step:*/15(every 15 units)
Real-World Examples
* * * * *— Every minute0 * * * *— Every hour (at minute 0)0 9 * * *— Every day at 9:00 AM0 9 * * 1-5— Weekdays at 9:00 AM0 0 * * 0— Every Sunday at midnight0 0 1 * *— First day of every month at midnight*/15 * * * *— Every 15 minutes0 9,17 * * 1-5— 9 AM and 5 PM on weekdays0 0 1 1 *— January 1st at midnight (yearly)30 2 * * 0— Sundays at 2:30 AM (good for maintenance)
Common Mistakes
- Forgetting that month and day-of-week are OR conditions, not AND
- Using
7for Sunday in systems where0is expected - Not accounting for timezone — cron uses the server's local time
- Scheduling jobs at
0 0 * * *— midnight is the most congested time
Test Before You Deploy
Our Cron Parser validates expressions and shows the next 10 execution times in human-readable format. Never deploy a cron job without verifying the schedule first.