Tools › Cron examples › every 15 minutes during business hours
Cron expression for every 15 minutes during business hours
The cron expression for every 15 minutes during business hours is:
What it does
Runs every 15 minutes from 09:00 to 17:45 on weekdays. The hour range 9-17 includes the whole 17:00 hour.
Field by field
| Field | Value | Meaning |
|---|---|---|
| Minute | */15 | step */15 |
| Hour | 9-17 | range 9-17 |
| Day of month | * | every value |
| Month | * | every value |
| Day of week | 1-5 | range 1-5 |
Typical uses
Polling that only matters while people are at work.
Watch out for
To stop at exactly 17:00, use */15 9-16 * * 1-5 and add 0 17 * * 1-5 as a separate line.
Add it to your crontab
crontab -e, then add:
*/15 9-17 * * 1-5 /path/to/command >> /var/log/myjob.log 2>&1