Cron Expression for Every Hour
Need to schedule a cron job to run every hour? This guide covers hourly, every-2-hour, every-30-minute, and other time-based cron schedules with clear examples. Use our cron expression generator to build these visually.
Quick Answer
The cron expression to run a job every hour:
0 * * * *
This executes at minute 0 of every hour — 1:00, 2:00, 3:00, and so on.
Common Hourly Cron Expressions
| Schedule | Expression | Description |
|---|---|---|
| Every hour | 0 * * * * | At minute 0 of every hour |
| Every 2 hours | 0 */2 * * * | 0:00, 2:00, 4:00, 6:00... |
| Every 3 hours | 0 */3 * * * | 0:00, 3:00, 6:00, 9:00... |
| Every 6 hours | 0 */6 * * * | 0:00, 6:00, 12:00, 18:00 |
| Every 12 hours | 0 */12 * * * | Midnight and noon |
| Every 30 minutes | */30 * * * * | At minute 0 and 30 |
| Every 15 minutes | */15 * * * * | At 0, 15, 30, 45 |
| Hourly on weekdays | 0 * * * 1-5 | Every hour, Mon-Fri |
| Every 2h at night | 0 */2 0-6 * * | Every 2h, midnight-6AM |
How It Works
Breaking down 0 * * * * field by field:
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 (start of hour) |
| Hour | * | Every hour (0-23) |
| Day | * | Every day |
| Month | * | Every month |
| Weekday | * | Every day of week |
The 0 in the minute field is key — it tells cron to execute exactly at the start of each hour. Using * instead would run the job every minute.
Understanding the Step Operator
The slash (/) defines a step interval. */2 means "every 2nd unit starting from 0":
0 */2 * * * # Runs at: 0:00, 2:00, 4:00, 6:00, 8:00, 10:00, 12:00...
With a custom starting point — every 2 hours from 1:00 AM:
0 1-23/2 * * * # Runs at: 1:00, 3:00, 5:00, 7:00, 9:00, 11:00...
Platform-Specific Notes
Linux Crontab
Standard 5-field expression. Add to crontab with crontab -e:
0 * * * * /path/to/your/script.sh
AWS CloudWatch
AWS uses 6 fields with year. Equivalent hourly expression:
0 * * * ? *
Note the ? instead of * in day-of-week. See our AWS cron guide.
Quartz (Java/Spring)
Quartz adds a seconds field. Hourly expression:
0 0 * * * ?
See our Quartz guide.
FAQ
What's the difference between 0 * * * * and * * * * *?
0 * * * * runs once per hour at minute 0. * * * * * runs every minute (60 times per hour). The first field 0 means "only at minute 0", while * means "every minute".
How do I run every hour during business hours only?
0 9-17 * * 1-5 — every hour from 9 AM to 5 PM, Monday through Friday.
How do I run on the half hour?
30 * * * * — at minute 30 of every hour (1:30, 2:30, 3:30...).
Can I run every 90 minutes?
Standard cron doesn't support 90-minute intervals (90 doesn't divide evenly into 60). Use two cron entries or your script's own scheduling logic.
Try It
Create your own hourly cron expression with our free cron generator — build and test schedules visually with instant preview.