- Home
- Tools
- Developer Tools
- Cron Expression Explainer
- Cron Expression for Every Hour
Cron Expression for Every Hour
0 * * * * runs a job once an hour, at minute 0. See the next run times, and the one character that would make it run every minute.
At the start of every hour
| Field | Value | Matches |
|---|---|---|
| Minute | 0 | 0 |
| Hour | * | every hour |
| Day of month | * | every day of the month |
| Month | * | every month |
| Day of week | * | every day of the week |
Next 10 runs
Cron goes by the clock of the machine it runs on. These are the runs on a machine in your time zone.
The zero matters
0 * * * * runs at minute 0 of every hour, 24 times a day. The shortcut @hourly means exactly this.
The zero is what makes it hourly. Replace it by a star and the job runs every minute. * */1 * * * is the same mistake in disguise: the step says "every hour", the star in front still says "every minute of it".
| Expression | Runs |
|---|---|
| 0 * * * * | At the start of every hour |
| @hourly | At the start of every hour |
| 30 * * * * | At minute 30 of every hour |
| 0 9-17 * * 1-5 | Every hour from 09:00 to 17:00 on Monday to Friday |
| 0 0-21/3 * * * | At the start of every 3rd hour |
| 30 1-22/3 * * * | At minute 30 of hours 1, 4, 7, 10, 13, 16, 19 and 22 |
At another minute
Any single number in the first field gives one run an hour: 30 * * * * is at half past. Avoiding minute 0 is often wise, since that is when most other hourly jobs on the machine and on the services it talks to start as well.
An hour and a half
Steps are counted within one field, so no single expression means "every 90 minutes". Two lines do it. The first takes every third hour on the hour, the second fills in the half hours between them:
0 0-21/3 * * * /path/to/job
30 1-22/3 * * * /path/to/job
Together they run at 00:00, 01:30, 03:00, 04:30 and on to 22:30.
The cron expression explainer has the full syntax: the five fields, lists, ranges and steps, and how day of month and day of week work together.