If you have ever set up a database backup, configured a newsletter dispatch, or run a background cleanup task in Linux, you have likely run into Cron. You can generate and translate expressions into plain English instantly with our Cron Expression Generator.
Cron is a time-based job scheduler in Unix-like operating systems. It is incredibly powerful, allowing jobs to run automatically at a specific second, minute, hour, or day. However, standard cron syntax is notoriously cryptic. An expression like */15 9-17 * * 1-5 looks like absolute gibberish to the uninitiated (and is easily forgotten even by seasoned developers).
In this guide, we will dissect cron syntax field-by-field, explain how special characters function, provide a quick reference cheat sheet, and offer an interactive 100% private, client-side Cron-to-English parser directly inside this post.
The Anatomy of a Cron Expression
Standard cron expressions are composed of five fields separated by spaces. (Note: Some environments like Spring, Quartz, or AWS EventBridge use 6 or 7 fields to include seconds and years, but standard system cron utilizes five).
ββββββββββββββ minute (0 - 59)
β ββββββββββββββ hour (0 - 23)
β β ββββββββββββββ day of month (1 - 31)
β β β ββββββββββββββ month (1 - 12)
β β β β ββββββββββββββ day of week (0 - 6) (Sunday to Saturday; 7 is also Sunday in some systems)
β β β β β
* * * * *
The 5 Standard Fields:
- Minute (
0 - 59): The exact minute the command runs. - Hour (
0 - 23): The hour of the day (in 24-hour format). - Day of Month (
1 - 31): The day of the calendar month. - Month (
1 - 12orJAN - DEC): The month of the year. - Day of Week (
0 - 6orSUN - SAT): The day of the week (where0or7is Sunday,1is Monday, and so on).
Deciphering Special Characters
To create flexible schedules, cron employs several special characters:
*(Asterisk - Any Value): Acts as a wildcard. If placed in the hour field, it means βevery hour.β,(Comma - Value List): Separates items in a list. For example,1,3,5in the day of week field means βrun only on Monday, Wednesday, and Friday.β-(Hyphen - Value Range): Defines a range of values. For example,9-17in the hour field means βrun every hour between 9 AM and 5 PM inclusive.β/(Slash - Step Values): Specifies increments. For example,*/15in the minute field means βevery 15 minutes.β Similarly,1-30/5means βevery 5 minutes starting from minute 1 up to minute 30.β
Interactive Demo: Client-Side Cron Translator
Type or paste a cron expression below to see it translated into a human-readable description. Since everything runs inside your browserβs local memory, your schedules are completely private.
The Ultimate Cron Cheat Sheet
Keep these common crontab schedule patterns handy when setting up your configuration files:
| Cron Expression | Human Interpretation | Usage Scenario |
|---|---|---|
* * * * * | Every single minute | Continuous health probes / WebSockets |
*/5 * * * * | Every 5 minutes | Log parsing and queuing scripts |
0 * * * * | Every hour (at minute 0) | Refreshing cache indices |
0 */2 * * * | Every 2 hours | Medium-priority API sync jobs |
0 0 * * * | Every day at midnight | Database backups & reporting |
0 3 * * 0 | Weekly on Sunday at 3:00 AM | Database index defragmentation |
0 0 1 * * | Monthly on the 1st at midnight | System subscription charges |
0 9 * * 1-5 | Every weekday morning at 9:00 AM | Notification alerts / Slack standups |
Crucial Gotchas to Keep in Mind
When scheduling automated tasks, you will eventually make a mistake. Avoid these three common issues:
1. The Timezone Hazard
By default, the cron daemon runs in the systemβs local timezone (usually set to UTC on cloud virtual machines). If your local timezone is EST but your server runs on UTC, scheduling a backup for 0 3 * * * (3 AM) means it will actually run at 11 PM EST. Always check your server timezone with the date command before setting schedules.
2. Output and Log Handling
Cron commands run silently in the background. If your script outputs errors or logs, they are typically piped into local mail directories (or thrown away). Best practice is to redirect standard output (stdout) and error streams (stderr) into a logging file:
# Append script logs to a local file
30 2 * * * /path/to/script.sh >> /var/log/my-script.log 2>&1
3. Missing Environment Paths
Cron processes run inside a very minimal shell environment. This means system paths to standard utilities (like node, python, or pg_dump) might not be loaded. Always use absolute filepaths for both executable utilities and script targets:
# Correct: Using absolute path to binaries
0 0 * * * /usr/local/bin/node /home/user/apps/backup.js
Take It To The Next Level
If you are writing complex, multiple cron configurations, or want a full layout editor with visual builders, check out our offline Cron Expression Generator. It supports standard inputs and visual selectors to let you construct valid schedules without writing a single line of raw syntax.