Cron Syntax Reference — Every Field, Every Shortcut, Every Gotcha
Complete crontab reference: the 5 fields, ranges, steps, @reboot / @daily shortcuts, weekday/dayofmonth OR gotcha, timezone handling, and 30 real cron examples.
The 5 fields
┌─── minute (0–59)
│ ┌─── hour (0–23)
│ │ ┌─── day of month (1–31)
│ │ │ ┌─── month (1–12)
│ │ │ │ ┌─── day of week (0–6, 0=Sunday)
│ │ │ │ │
* * * * * command_to_run
Field syntax
| Syntax | Meaning | Example |
|---|---|---|
* | Every value in this field | * * * * * = every minute |
a,b,c | List of specific values | 0,15,30,45 * * * * = every 15 min |
a-b | Range | 0 9-17 * * * = every hour 9am-5pm |
*/n | Every n units, starting from 0 | */5 * * * * = every 5 min |
a-b/n | Every n units within a range | 0 8-18/2 * * * = every 2 hours, 8am-6pm |
Shortcuts (most crons, not all)
| Shortcut | Equivalent |
|---|---|
@yearly / @annually | 0 0 1 1 * |
@monthly | 0 0 1 * * |
@weekly | 0 0 * * 0 |
@daily / @midnight | 0 0 * * * |
@hourly | 0 * * * * |
@reboot | Runs once when cron starts (systemd cron only) |
30 real cron examples
| Cron | When it runs |
|---|---|
* * * * * | Every minute |
*/5 * * * * | Every 5 minutes |
*/10 * * * * | Every 10 minutes |
*/15 * * * * | Every 15 minutes |
*/30 * * * * | Every 30 minutes |
0 * * * * | Every hour, on the hour |
15 * * * * | 15 minutes past every hour |
0 */2 * * * | Every 2 hours |
0 */6 * * * | Every 6 hours (00:00, 06:00, 12:00, 18:00) |
0 9 * * * | Every day at 9:00 AM |
30 2 * * * | Every day at 2:30 AM |
0 0 * * * | Every day at midnight |
0 9 * * 1-5 | Weekdays at 9 AM (Mon-Fri) |
0 9 * * 1 | Every Monday at 9 AM |
0 9 * * 6,0 | Weekends at 9 AM |
0 0 1 * * | First day of every month at midnight |
0 0 L * * | Last day of month (Quartz only) |
0 0 15 * * | 15th of each month at midnight |
0 0 * * 0 | Every Sunday at midnight |
0 22 * * 5 | Every Friday at 10 PM |
0 0 1 1 * | Once a year, Jan 1st midnight |
0 0 1 */3 * | Every quarter (Jan 1, Apr 1, Jul 1, Oct 1) |
0 0 1,15 * * | 1st and 15th of every month |
5 4 * * sun | Sundays at 4:05 AM |
0 8-18 * * 1-5 | Every hour 8-18, weekdays |
45 23 * * * | Daily at 11:45 PM |
0 4 8-14 * * | 2nd week of the month at 4 AM |
0 0 * * 1#2 | 2nd Monday of the month (Quartz) |
H/5 * * * * | Every 5 min, hashed offset (Jenkins) |
* * * * * * | Every second (6-field cron only: Quartz, node-cron) |
The day-of-month vs day-of-week gotcha
When BOTH day-of-month AND day-of-week are non-star, standard cron uses OR, not AND. So 0 0 15 * 1 means "at midnight on the 15th OR every Monday" — probably not what you want. If you need "the 15th if it's a Monday", handle it in your script with a date check.
Timezone handling
- System cron uses the machine's local time (see
TZenv in crontab). - systemd timers can specify
OnCalendarwith an explicit timezone. - Cloudflare Cron Triggers and GitHub Actions use UTC. Always. If your job says "run at 9 AM" in New York time in November, that's
0 14 * * *in UTC — and it becomes0 13 * * *in daylight saving. If it matters, use two cron entries. - AWS EventBridge supports
cron(0 9 * * ? *)with 6 fields — the ? means "no specific value". Uses UTC.
Non-standard extensions to know
- Quartz (Java): 6 fields (seconds first),
L(last),W(weekday nearest),#(nth weekday of month). - Jenkins:
Hmeans "hash" — spreads jobs across builders to avoid the thundering-herd on0 * * * *. - node-cron: 6 fields with seconds.
- fcron / systemd:
%for run-once conditions.
Debug your cron
- Build cron expressions with the visual builder
- Test the schedule:
crontab -llists your active crontab,tail -f /var/log/syslog | grep CRONshows executions. - Nothing running? Check the user's crontab, not just root. Check paths — cron has a minimal
PATH. Check that the script is executable.
Featured Tools
Try these free tools directly in your browser — no sign-up required.
Cron Job Generator
Free cron job generator with visual builder. Create cron expressions for Linux crontab, AWS, GitHub Actions, Kubernetes. See next run times instantly.
Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back. Supports seconds and milliseconds timestamps with timezone conversion for debugging and development.