Cron every 15 minutes on weekdays: */15 * * * 1-5
*/15 * * * 1-5 runs on the quarter hours from Monday to Friday, 96 times a weekday and 480 times a week.
At a glance
- Expression
- */15 * * * 1-5
- Fires
- 96 times a weekday, 480 times a week, about 25,000 times a year.
- Restricted fields
- Minute stepped by 15 and day of week restricted to 1-5. Hour, day of month and month are open.
- Equivalent macro
- None.
- Minutes matched
- 0, 15, 30 and 45 of every hour.
- Weekly saving
- 480 runs a week instead of the 672 that */15 * * * * would produce.
In detail
This is the first expression in the set that restricts two fields at once, and it is the easy case: the minute field carries the frequency and the day of week field carries the calendar rule. Because the day of month field is left open, the two restrictions combine the way you would expect, and the job runs on the quarter hours of weekdays only.
Dropping the weekend removes 192 runs a week, which matters less for load than for noise. A job that alerts when an upstream system is quiet will alert all weekend if nothing is expected to happen, and two days of false alarms every week is how people learn to ignore the channel the alerts arrive in.
The hour field is still open, so this runs through the night as well. If the point is to poll during working hours, adding an hour range narrows it dramatically: */15 9-17 * * 1-5 gives 36 runs a weekday and 180 a week, which is a third of the volume for the same business coverage.
The runs land on the quarter hours, which is where a lot of other scheduled work already sits. If the job talks to a shared service that is busiest at the top of the hour, 7-59/15 * * * 1-5 keeps the four runs an hour and the weekday restriction while moving every run off the crowded minutes.
Examples
*/15 * * * 1-5*/15 9-17 * * 1-5 /opt/app/bin/poll.sh >> /var/log/poll.log 2>&136 runs a weekday, 180 a week.
7-59/15 * * * 1-5Fires at 7, 22, 37 and 52 past on weekdays.
Things that catch people out
- The weekday restriction applies to the date the run starts on. A run at 00:00 Monday is a Monday run, even though it is really Sunday night to a human.
- Adding a day of month restriction to this expression switches the two date fields to OR and the weekday limit stops holding.
- 480 runs a week against a rate limited API is 2,000 a month per host. Count hosts before assuming the quota fits.
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 15 minutes: */15 * * * *
*/15 * * * * fires 96 times a day on the quarter hours. What happens to the count on the two daylight saving days, and how 7-59/15 spreads the load.
Cron every weekday: 0 0 * * 1-5
0 0 * * 1-5 runs at midnight Monday through Friday, five times a week. Day numbers, the MON-FRI alias, and why holidays still get a run.
Cron during business hours: 0 9-17 * * 1-5
0 9-17 * * 1-5 runs hourly from 09:00 to 17:00 on weekdays, nine times a day and 45 times a week. The 17:00 run is included, not excluded.
Cron day of month and day of week: the OR rule
When both date fields are restricted, cron fires if either matches, not both. This turns narrowing expressions into much wider ones without any error.
Cron every 2 weeks: what cron cannot do and what to write
Cron has no fortnight. The two honest options are a semi monthly 1,15 schedule or a weekly job with a week parity test in the script.
Cron every other day: 0 0 */2 * * and the month reset
0 0 */2 * * runs on odd numbered days, 16 times in a 31 day month. The step resets each month, so the 31st and the 1st are consecutive runs.
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