Cron every hour at 30 minutes past: 30 * * * *
30 * * * * runs once an hour at thirty minutes past, 24 times a day. It is an ordinary hourly schedule with the minute moved off zero.
At a glance
- Expression
- 30 * * * *
- Fires
- 24 times a day, 168 times a week.
- Restricted fields
- Minute only, pinned to 30. The hour and all three date fields are open.
- Equivalent macro
- None. @hourly is fixed at minute 0 and cannot be offset.
- Minute matched
- 30. The job starts at hh:30:00 local time.
- Relationship to @hourly
- Same frequency, shifted by half an hour. There is no macro for an offset hour.
In detail
Changing the minute from 0 to 30 does not change the frequency at all, only the phase. The job still runs 24 times a day, still once per hour, and still every day of the year. What it stops doing is competing with the pile of work that every system schedules on the hour.
Half past is the natural choice when the hourly job depends on something else that runs on the hour. If a metrics flush happens at hh:00 and takes a couple of minutes, a consumer at hh:30 reads a settled snapshot instead of racing the writer. The dependency is implicit and fragile, but it is far better than both jobs starting in the same second.
Any minute from 0 to 59 works, so if you run several hourly jobs, give each one a different offset rather than putting them all at 30. Spreading four hourly jobs across minutes 5, 20, 35 and 50 turns four simultaneous spikes into four small ones, with no change to what any of them does.
The offset does not survive being converted to a macro. @hourly is defined as 0 * * * * and there is no way to express half past with it, so a crontab that mixes @hourly and 30 * * * * is describing two genuinely different schedules even though people often talk about both as hourly.
Examples
30 * * * *5 * * * * /opt/app/bin/a.sh
20 * * * * /opt/app/bin/b.sh
35 * * * * /opt/app/bin/c.sh
50 * * * * /opt/app/bin/d.sh30 * * * 1-5 /opt/app/bin/sync.sh120 runs a week instead of 168.
Things that catch people out
- 30 * * * * and */30 * * * * differ by a single character and by a factor of two. The first is once an hour, the second is twice.
- Offsetting a job to dodge contention only helps if the contention is on the minute. If two jobs compete for the same lock for twenty minutes, moving one by thirty minutes helps, moving it by two does not.
- A job at hh:30 that reports on the hour it is in has only half the hour available. Reporting on the previous complete hour is almost always what was meant.
Try it: Cron Expression Parser
Paste any five or six field expression to get a plain English description, a per field breakdown and the next run times in your local time.
Cron Expression Parser
LOCAL · Browser-OnlyParse cron expressions and see the next scheduled run times
Supports 5-field (minute hour day month weekday), 6-field (with seconds), named values (JAN, MON), and @macros (@daily, @hourly, ...)
Use the dropdowns below to build your cron expression visually, or type a custom value in each field.
Human-Readable Description
Every 5 minutes
Field Breakdown
| Field | Allowed | Value | Meaning |
|---|---|---|---|
| Minute | 0-59 | */5 | every 5 minute(s) |
| Hour | 0-23 | * | every hour |
| Day of Month | 1-31 | * | every day of month |
| Month | 1-12 | * | every month |
| Day of Week | 0-7 | * | every day of week |
Related cron expressions
All cron expressions →Cron every hour: 0 * * * *
0 * * * * fires 24 times a day at the top of every hour and is what @hourly expands to. Why * */1 * * * is the mistake people make instead.
Cron every 30 minutes: */30 * * * *
*/30 * * * * fires 48 times a day at minutes 0 and 30. The half hour is the busiest slot on most servers, and 15,45 costs nothing to move to.
The cron minute field: position, range and behaviour
The minute field runs 0 to 59 and is the first field in a five field expression, or the second when a seconds field is present.
Cron every 2 hours: 0 */2 * * *
0 */2 * * * fires 12 times a day on even hours from 00:00 to 22:00. Use 0 1-23/2 * * * to run on odd hours instead, same twelve runs.
Cron every 3 hours: 0 */3 * * *
0 */3 * * * fires eight times a day at 00:00, 03:00, 06:00 and on to 21:00. Three divides 24 exactly, so the midnight gap is the same as the rest.
Cron every 4 hours: 0 */4 * * *
0 */4 * * * fires six times a day at 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00. Even spacing, and how to move the set off midnight.
Tools for this
- Cron Expression Parser Free online cron expression parser - parse cron expressions and see the next scheduled run times
- Crontab Generator Free online crontab generator - build cron expressions visually with an intuitive interface