Quick Answer: How to Read a 5-Field Crontab Expression
Standard crontab expressions follow the syntax [minute] [hour] [day_of_month] [month] [day_of_week]. An expression like 0 9 * * 1-5 means At 9:00 AM, Monday through Friday. An asterisk (*) matches all values, , specifies value lists (e.g. 1,15), - specifies ranges (e.g. 1-5), and / specifies step intervals (e.g. */15).
Crontab 5-Field Anatomy
Field 1Minute0 – 59
Field 2Hour0 – 23
Field 3Day of Month1 – 31
Field 4Month1 – 12 (Jan–Dec)
Field 5Day of Week0 – 6 (Sun–Sat)
Crontab Special Characters Reference
| Symbol | Meaning | Example | Description |
|---|---|---|---|
| * | Any / Every value | * * * * * | Triggers every minute of every hour |
| / | Step / Interval values | */15 * * * * | Every 15 minutes (at :00, :15, :30, :45) |
| , | Value list separator | 0 0 1,15 * * | At midnight on the 1st and 15th of the month |
| - | Range of values | 0 9-17 * * 1-5 | Every hour between 9 AM and 5 PM on weekdays |
Step-by-Step Case Study: Enterprise Automation Schedules
Here is how you write production cron expressions for common backend cron tasks:
- Nightly Database Backup:
0 2 * * *(Runs daily at 2:00 AM when server traffic is lowest). - Bi-Weekly Payroll Processing:
0 6 1,15 * *(Runs at 6:00 AM on the 1st and 15th of every month). - Weekly Sunday Maintenance Window:
30 3 * * 0(Runs at 3:30 AM every Sunday morning). - Hourly Health Check API Ping:
0 * * * *(Runs at the top of every hour).