*/15 * * * * runs a job every quarter of an hour: at minute 0, 15, 30 and 45. The cron parser calls it “Every 15 minutes” and expands the minute field to 0,15,30,45. The same schedule can also be written as a list: 0,15,30,45 * * * *.
Staggered versions
The default fires at the same moments as thousands of other jobs. To move away from those moments, give the schedule an offset:
| Expression | Runs at |
|---|---|
*/15 * * * * |
:00, :15, :30, :45 |
5-59/15 * * * * |
:05, :20, :35, :50 |
7,22,37,52 * * * * |
:07, :22, :37, :52 |
The parser shows 5-59/15 as “Every 15 minutes starting at minute 5”, and the list as “At minute 7, minute 22, minute 37 and minute 52”. Both keep the gap at 15 minutes. Offsets help when your job calls a shared service, a rate-limited API or a database that other tasks also hit on the hour.
Limit it to a time window
Add values to the other fields to restrict when it runs:
# every 15 minutes, 09:00-17:45, Monday to Friday
*/15 9-17 * * 1-5 /usr/local/bin/sync.sh >> /var/log/sync.log 2>&1
# every 15 minutes at night only (22:00-05:45)
*/15 22-23,0-5 * * * /usr/local/bin/batch.sh
Note the hour range: 9-17 includes the whole 17 o’clock hour, so the last run is 17:45. If the last run should be 17:00, use two entries: */15 9-16 * * 1-5 plus 0 17 * * 1-5.
Hours wrap-around is not allowed in a range (22-5 is invalid in most cron versions), so write it as two ranges, as in the example.
Things to check
- Time zone. The window
9-17is in the server’s zone. A server in UTC runs “9 to 5” in the middle of the night for a team in Hanoi. Some crons acceptCRON_TZ=Asia/Ho_Chi_Minhon a line of its own; check your version, or convert the hours. - Runtime. A job that takes more than 15 minutes overlaps with the next one. See
flockin every minute. - Output and logs. Redirect with
>> file 2>&1, or cron will try to mail every run. - Idempotency. If the machine was off at :30, cron does not catch up on missed runs. The next run must be able to cover the gap (use timestamps in the data, not “the last 15 minutes”).
Cron against a faster pace
If 15 minutes is too slow, see every 5 minutes or every minute. If a job needs to react to events, a queue or a webhook is better than polling. Build and test any expression in the cron builder, and read cron and time zones for what happens around clock changes.
Frequently asked questions
What is the cron expression for every 15 minutes?
*/15 * * * *, which is the same as 0,15,30,45 * * * *. The job runs at the quarter hours of every hour of every day.
How do I run every 15 minutes during working hours only?
Limit the hour field: */15 9-17 * * 1-5 runs every 15 minutes from 09:00 to 17:45 on weekdays. The last run of the 17 o'clock hour is at 17:45, so use 9-16 plus a separate entry if 17:00 must be the last one.
Why would I not start exactly at minute 0?
Everyone does it, so :00, :15 and :30 are the busy moments for shared APIs, DNS and databases. A start such as 7,22,37,52 spreads the load and rarely costs anything.
Does */15 survive a daylight saving change?
Yes. The step is within the hour, so a one-hour clock change shifts nothing in the pattern. It is the jobs set to a time of day that skip or repeat.
More in this reference
- Cron daily at midnight (0 0 * * *): @daily, time zones and a better hour
- Cron every 5 minutes (*/5 * * * *): syntax, the step operator and its limits
- Cron every 6 hours (0 */6 * * *): steps in the hour field
- Cron every hour (0 * * * *): @hourly, and the mistake of * 0 * * *
- Cron every minute (* * * * *): how it works and the traps
- Cron every Monday at 9 AM (0 9 * * 1) and the day-of-month OR trap
- Cron on the first day of the month (0 0 1 * *): @monthly and its limits
- Cron on the last day of the month: why there is no L, and three working solutions
- Cron on weekdays at 9 AM (0 9 * * 1-5): Monday to Friday