A cron expression is five space-separated fields, minute, hour, day-of-month, month, and day-of-week, that tell cron when to run a command: 0 9 * * 1 means 09:00 every Monday. Pick a frequency below to generate a valid line, or switch to Explain and paste an expression to read it back in plain English. Cron syntax is famously easy to get subtly wrong, so check it here before it runs at the wrong time for a month.
0 9 * * *Runs at 09:00, every day.
New to cron and want the full walkthrough, opening the crontab, the shorthand strings, the environment traps, and how to confirm a job ran? That lives in how to schedule a cron job on Linux. This page is the quick generator and reference.
The five fields
A cron line is five space-separated fields, then the command:
┌───── minute (0 - 59)
│ ┌───── hour (0 - 23)
│ │ ┌───── day of month (1 - 31)
│ │ │ ┌───── month (1 - 12)
│ │ │ │ ┌───── day of week (0 - 6, Sunday = 0)
│ │ │ │ │
0 9 * * 1 /path/to/script.sh
That example runs at 09:00 every Monday. Each field accepts:
*for "every" (every minute, every day, and so on),- a number (
9), - a step
*/15for "every 15", - a range
1-5, - a list
1,3,5.
Common schedules
| Expression | Runs |
|---|---|
* * * * * | every minute |
*/15 * * * * | every 15 minutes |
0 * * * * | at the start of every hour |
0 9 * * * | every day at 09:00 |
0 9 * * 1-5 | every weekday at 09:00 |
0 9 * * 1 | every Monday at 09:00 |
0 9 1 * * | the 1st of every month at 09:00 |
0 0 1 1 * | once a year, midnight on Jan 1 |
The gotchas that bite
- Day-of-month and day-of-week are OR, not AND.
0 9 13 * 5does not mean "Friday the 13th"; it runs on the 13th and every Friday. If both fields are restricted, cron runs when either matches. The builder flags this for you. - Cron uses the system (or the cron daemon's) timezone, not yours. A job set for 02:00 runs at 02:00 server time. Check with
timedatectlbefore trusting a late-night schedule. - A bare
%in the command is a newline to cron. Escape it as\%(this trips update +%Y-%m-%done-liners constantly). - Cron runs with a minimal environment and a short
PATH. "Works in my shell, not in cron" is almost always a missing absolute path or an unset variable. Use full paths, or source your environment at the top of the script. - No output means an email. If the command prints anything, cron tries to mail it to the user. Redirect with
>> /var/log/job.log 2>&1so a chatty job does not silently fill a mail spool.
Editing your crontab
crontab -e # edit your user's crontab (syntax-checked when you save)
crontab -l # list it
crontab -r # remove it (careful, no confirmation)System-wide jobs live in /etc/crontab and /etc/cron.d/, where there is an extra field for the user to run as, between the day-of-week and the command. Per-user crontabs (crontab -e) do not have that field.
FAQ
See also
- How to schedule a cron job on Linux: the full guide, from opening the crontab to debugging a job that did not run.
- How to give a user sudo access: cron jobs that need elevation run as a specific user.
- How to create a user on Linux: service accounts that own scheduled jobs.
- Linux file permissions explained: make the script the cron line points at executable.
- SSH Cheat Sheet: for the scheduled jobs that rsync or run commands over SSH.
Sources
Authoritative references this article was fact-checked against.





