Every developer has done it. You stare at 0 3 * * 1-5, count the asterisks three times, deploy it — and the job runs at completely the wrong time.
Cron is powerful, but its syntax was clearly designed in an era when readability was optional. Let's fix that permanently.
🛠️ Free Tool: Cron Job Generator — WebToolsHub — build cron expressions visually, see the next run times in plain English. No signup, runs in your browser.
The 5 Fields, Once and For All
┌───────────── minute (0–59) │ ┌───────────── hour (0–23) │ │ ┌───────────── day of month (1–31) │ │ │ ┌───────────── month (1–12) │ │ │ │ ┌───────────── day of week (0–7, 0 and 7 = Sunday) │ │ │ │ │ * * * * * Three symbols do almost everything:
-
*— every value ("every minute", "every day") -
,— list:1,15= the 1st and 15th -
-— range:1-5= Monday to Friday -
/— step:*/15= every 15
The Expressions You Will Actually Use
0 * * * * # Every hour, on the hour */15 * * * * # Every 15 minutes 0 0 * * * # Every day at midnight 0 9 * * 1-5 # 9 AM, Monday to Friday only 0 0 1 * * # Midnight on the 1st of every month 30 2 * * 0 # 2:30 AM every Sunday (classic backup slot) 0 */6 * * * # Every 6 hours The 3 Traps That Bite Everyone
1. Day-of-month AND day-of-week is an OR, not an AND.
0 0 13 * 5 does not mean "Friday the 13th." It means "the 13th of every month, AND every Friday." This is standard cron behavior and it surprises everyone once.
2. Timezones are the server's, not yours.
Your laptop says 9 AM; the server in UTC disagrees. Most production cron surprises are timezone surprises. Always check what timezone your scheduler uses.
3. A job that fails silently will fail forever.
Cron has no dashboard and no mercy. Log output (>> /var/log/job.log 2>&1) or use a scheduler that alerts on failure.
Stop Writing Cron From Memory
Even after years, I still verify every non-trivial expression before deploying it — because "I think this runs on weekdays" is how you page someone at 3 AM on a Saturday.
The free Cron Job Generator lets you pick the schedule visually, shows the expression, and — most importantly — lists the next actual run times in plain language so you can sanity-check them before anything goes live.
Bookmark the cheat sheet. Verify the expression. Sleep well.
What cron job caused your worst production surprise? I read every comment.
