
Confused by asterisks? Learn how to schedule tasks effectively with cron syntax without accidentally nuking your database.
I Once Crashed a Production Server With a Single Asterisk
True story. I meant to run a cleanup script once at 5 AM. The correct syntax is 0 5 * * *.
I wrote * 5 * * *.
That one missing zero meant the script ran every single minute from 5:00 to 5:59 AM—60 times instead of once. The script locked the database. Users couldn't log in. I got paged at 5:30 AM.
All because of one character in a 70-year-old scheduling syntax.
Cron Is Ancient Technology (And That's The Problem)
The cron utility was written in 1975. It's been running scheduled tasks on Unix systems for nearly 50 years. That's both impressive and terrifying.
The syntax made sense in an era of limited computing resources and teletypes. Five fields, space-separated, representing minute, hour, day of month, month, day of week. No labels, no hints, no error messages.
According to Stack Overflow's yearly surveys, cron-related questions consistently appear in the top 100 most-asked DevOps questions. We're all confused by this thing.
The Fields Explained (Because I Still Forget)
After 8 years of working with Linux servers, here's my reference:
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *
Common patterns I actually use:
0 5 * * *- Every day at 5:00 AM*/15 * * * *- Every 15 minutes0 0 * * 0- Every Sunday at midnight0 9-17 * * 1-5- Every hour from 9 AM to 5 PM, weekdays only
Why "Silent Failure" Is Cron's Worst Feature
JavaScript throws errors. Python crashes with tracebacks. Cron? Nothing.
If your cron expression is wrong, it just... doesn't run. No error message. No notification. Your backup script silently stops working and you don't notice until you need those backups.
If your expression is syntactically valid but semantically wrong (like my asterisk mistake), it runs too often or at the wrong time. Still no warning.
This is why I never write cron expressions by hand anymore.
The Visual Approach
The Cron Job Generator does bidirectional translation:
Building new schedules:
- Select the frequency (daily, weekly, monthly, custom)
- Choose your timing (4 PM, Tuesday, first of month)
- Get the exact cron syntax
Debugging existing schedules:
- Paste a cron expression like
*/30 9-17 * * 1-5 - See plain English: "Every 30 minutes, 9 AM to 5 PM, Monday through Friday"
No more guessing. No more Stack Overflow searches.
Best Practices From Years of Production Experience
Always use absolute paths. Cron doesn't know your shell's PATH. Write /usr/bin/node script.js, not just node script.js.
Log everything. Append >> /var/log/myjob.log 2>&1 to capture output and errors. When something fails, logs are your only clue.
Use which to find binary paths. Run which node or which python3 to get the exact path you need.
Test your commands manually first. Before adding to crontab, run the exact command in your terminal to verify it works.
Consider timezone. Cron uses server time, not your local time. If your server is UTC but you're in New York, 5 AM cron runs at 1 AM Eastern.
Use monitoring. Services like Cronitor or Healthchecks.io will alert you if a scheduled job doesn't run when expected.
The Stakes Are Real
I've seen teams lose weeks of database backups because a cron job silently failed. I've seen runaway scripts cause million-dollar AWS bills because they ran every minute instead of every hour.
Cron syntax isn't just inconvenient—it's a genuine production risk. Use the Generator and eliminate the guessing.
Written by Axonix Team
Axonix Team - Technical Writer @ Axonix
Share this article
Discover More
View all articles
JWTs Explained: No More Auth Headaches
JSON Web Tokens are the standard for stateless authentication. But how do they actually work? We break down the header, payload, and signature so you can implement auth securely.

Why You Should Stop Writing TypeScript Interfaces Manually
Manually typing API responses is the biggest waste of developer time. Here is how to automate typings and get Zod schemas for free.

JSON Debugging: How I Stopped Losing My Mind Over Missing Commas
Real stories from the JSON debugging trenches. Learn from my pain as we explore common errors, validation tricks, and why that one comma cost me 2 hours of my life.
Use These Related Tools
View all toolsCron Logic
Visual cron expression generator with human-readable explanations.
Crontab Reference
Decode cron expressions into human-readable schedules instantly.
DNS Checker
Check DNS record propagation across global servers for A, MX, CNAME, and TXT records.
Contrast Checker
Verify color contrast ratios against WCAG accessibility standards.
Ready to boost your productivity?
Axonix provides 20+ free developer tools to help you code faster and more securely.
Explore Our Tools