What Is a Cron Job? (Concept and Anatomy)
A cron job is a task scheduled to run automatically at fixed times, dates, or intervals on Unix-like systems. The cron daemon reads a file called a crontab, where each line defines a schedule using five time fields followed by the command to run — for example, "every day at 3 AM, back up the database."
Cron is the oldest and most widely used job scheduler in computing. Here's how it works.
What Is Cron?
Cron is a background service (daemon) on Unix/Linux/macOS that checks the clock every minute and runs any commands whose schedule matches the current time. You define those schedules; cron handles the rest, forever, without you being logged in.
The name comes from Chronos, the Greek word for time.
A Cron Job vs Cron vs Crontab
These related terms trip people up:
- cron — the scheduler daemon that runs in the background.
- crontab — the configuration file (and the
crontabcommand to edit it) listing scheduled jobs. - cron job — a single scheduled task defined by one line in the crontab.
The 5-Field Schedule Syntax
Every cron job starts with five time fields:
* * * * * command-to-run
│ │ │ │ │
│ │ │ │ └─ day of week (0–6, Sun=0)
│ │ │ └─── month (1–12)
│ │ └───── day of month (1–31)
│ └─────── hour (0–23)
└───────── minute (0–59)
A * means "every" value for that field. You can also use:
- Lists:
1,15,30 - Ranges:
9-17 - Steps:
*/5(every 5 units)
Building these by hand is error-prone — our Cron Expression Generator lets you pick a schedule visually and gives you the exact expression.
Reading a Crontab Line
Walk through a real example:
30 2 * * 1 /scripts/backup.sh
30minute → at minute 302hour → 2 AM*day of month → any day*month → any month1day of week → Monday
So: "Run /scripts/backup.sh at 2:30 AM every Monday."
Common Schedule Examples
| Expression | Meaning |
|---|---|
* * * * * |
Every minute |
0 * * * * |
Every hour, on the hour |
0 0 * * * |
Every day at midnight |
*/15 * * * * |
Every 15 minutes |
0 9 * * 1-5 |
9 AM on weekdays |
0 0 1 * * |
Midnight on the 1st of each month |
What Cron Jobs Are Used For
- Backups — nightly database and file backups.
- Maintenance — log rotation, cache clearing, cleanup scripts.
- Reports & emails — scheduled digests and exports.
- Data syncs — periodic API pulls and ETL jobs.
- Health checks — recurring monitoring tasks.
For one-off or precise time math around scheduling, the Unix Timestamp Converter is a handy companion. For building and validating the expressions themselves, see Cron Expression Guide: Syntax and Examples.
Frequently Asked Questions
What is a cron job? A task scheduled to run automatically at set times or intervals on a Unix-like system, defined by one line in a crontab file.
What does cron stand for? It's derived from "Chronos," the Greek word for time — not an acronym.
How does the cron schedule syntax work?
Five fields (minute, hour, day of month, month, day of week) specify when to run; * means every value, and you can use lists, ranges, and steps.
Where is the crontab stored?
Per-user crontabs live under the system's cron spool (e.g., /var/spool/cron/), edited via crontab -e; system-wide jobs live in /etc/crontab and /etc/cron.d/.
What's the difference between cron and a cron job? Cron is the scheduler daemon; a cron job is a single scheduled task it runs.
Related Reading
Once the five fields click, cron becomes second nature: describe when in five numbers, point it at a command, and the job runs on time, every time.