The short answer:
*/5 * * * * /path/to/command
That runs at :00, :05, :10 and so on, every hour of every day. The rest of this page lists the schedules people search for most, then explains the fields so you can write your own. To check any expression in plain English, paste it into the Cron Expression Explainer.
The five fields
┌───────────── minute (0–59) │ ┌─────────── hour (0–23) │ │ ┌───────── day of month (1–31) │ │ │ ┌─────── month (1–12) │ │ │ │ ┌───── day of week (0–6, Sunday = 0; 7 is also Sunday on most systems) │ │ │ │ │ * * * * * command
| Symbol | Meaning | Example |
|---|---|---|
* | every value | * in hour = every hour |
, | list | 1,15 = the 1st and 15th |
- | range | 1-5 = Monday to Friday |
/ | step | */10 = every 10th value |
Minute and hour schedules
| Schedule | Expression |
|---|---|
| Every minute | * * * * * |
| Every 2 minutes | */2 * * * * |
| Every 5 minutes | */5 * * * * |
| Every 10 minutes | */10 * * * * |
| Every 15 minutes | */15 * * * * |
| Every 30 minutes | */30 * * * * |
| Every hour, on the hour | 0 * * * * |
| Every hour at :30 | 30 * * * * |
| Every 2 hours | 0 */2 * * * |
| Every 6 hours | 0 */6 * * * |
A common slip: * */2 * * * runs every minute during every second hour. If you want once every two hours, set the minute to 0.
Daily, weekly and monthly schedules
| Schedule | Expression |
|---|---|
| Every day at midnight | 0 0 * * * |
| Every day at 9:00 | 0 9 * * * |
| Twice a day (9:00 and 18:00) | 0 9,18 * * * |
| Weekdays at 9:00 | 0 9 * * 1-5 |
| Weekends at 10:00 | 0 10 * * 0,6 |
| Every Monday at 8:00 | 0 8 * * 1 |
| First day of the month at midnight | 0 0 1 * * |
| 1st and 15th at noon | 0 12 1,15 * * |
| Every 5 minutes during work hours, weekdays | */5 9-17 * * 1-5 |
| Once a year, 1 January | 0 0 1 1 * |
Shortcuts
Most cron implementations (Vixie cron, cronie, macOS) accept these:
| Shortcut | Same as |
|---|---|
@hourly | 0 * * * * |
@daily | 0 0 * * * |
@weekly | 0 0 * * 0 |
@monthly | 0 0 1 * * |
@yearly | 0 0 1 1 * |
@reboot | once at startup |
Hosted schedulers (GitHub Actions, Vercel, Kubernetes CronJobs) usually accept the five-field form but not always the @ shortcuts, so the five-field version is the safer choice.
The day-of-month and day-of-week trap
If you set both day of month and day of week, classic cron runs the job when either matches, not both. 0 9 1 * 1 runs on the 1st of the month and on every Monday. To run "the first Monday of the month", schedule it for Mondays and check the date inside the script:
0 9 * * 1 [ "$(date +\%d)" -le 07 ] && /path/to/command
Note the \%. In a crontab line, an unescaped % is treated as a newline, which silently breaks the command.
Other mistakes that bite
- Time zone. Cron uses the server's time zone, and hosted schedulers usually use UTC. See Why Your Cron Job Ran at the Wrong Time.
- PATH. Cron runs with a minimal environment. Use absolute paths (
/usr/bin/node, notnode). - No output. Redirect logs so you can see failures:
*/5 * * * * /path/script.sh >> /var/log/script.log 2>&1. - Overlapping runs. If a job can take longer than its interval, wrap it in
flock -n /tmp/job.lockso a second copy doesn't start.
Editing your crontab
crontab -e # edit crontab -l # list