Skip to content

Cron Every 30 Minutes During Business Hours: */30 9-17 * * 1-5 Explained

*/30 9-17 * * 1-5 Every 30 minutes, 09:00-17:59, Monday-Friday business

The cron expression */30 9-17 * * 1-5 combines three restrictions at once: it runs every 30 minutes, only during the hours 9 through 17, and only on weekdays (day-of-week 1-5). Ranges in the hour field are inclusive, so 9-17 covers 09:00 all the way through 17:59 — the last execution of the day is at 17:30 for the half-hour variant and 17:00 for the hourly variant, not 18:00. This pattern is the standard shape for office-hours automation: CRM syncs, ticket-queue polling, inventory refreshes and dashboards that only need to be fresh while staff are working. Combining fields multiplies restrictions (AND logic across minute/hour/weekday), which is different from the OR trap that applies when both day fields are set. Outside the window the job simply never fires, so downstream consumers must tolerate data that is up to ~16 hours stale overnight and all weekend. The field table below decodes each part, the computed next-run list shows exactly where the window boundaries land, and the platform conversions cover Quartz, Spring, Kubernetes and EventBridge.

Advertisement
Ad slot · ref-top

Field-by-field breakdown

FieldValueMeaning
minute*/30every 30 minutes, stepping from the start of the range (0 for minutes/hours, 1 for days)
hour9-17every hour from 9 through 17 inclusive
day-of-month*every day-of-month (wildcard, no restriction)
month*every month (wildcard, no restriction)
day-of-week1-5every day-of-week from 1 through 5 inclusive

Next 5 run times (UTC)

Computed at build time; cross-check against your server's time zone before deploying.

  • 2026-12-07 09:00 UTC
  • 2026-12-07 09:30 UTC
  • 2026-12-07 10:00 UTC
  • 2026-12-07 10:30 UTC
  • 2026-12-07 11:00 UTC

When to use this schedule

  • Office-hours polling of ticket queues, CRMs and inventory systems while staff are actively working.
  • Dashboards and internal tools that only need fresh data during the working window.
  • Rate-limited third-party API syncs where overnight and weekend calls would waste quota.
  • Notification digests batched during business hours instead of paging people at night.

Equivalent syntax

The same schedule expressed for popular schedulers and platforms:

Crontab (5-field)
*/30 9-17 * * 1-5 /usr/local/bin/job.sh   # Every 30 minutes, 09:00-17:59, Monday-Friday
Quartz (6/7-field)
0 0/30 9-17 ? * MON-FRI   # Quartz (Java): 6-7 fields, leading seconds, '?' when day-of-week is set
Spring @Scheduled
0 */30 9-17 * * MON-FRI   # Spring @Scheduled: 6 fields, leading seconds, day names accepted
Kubernetes CronJob
*/30 9-17 * * 1-5   # Kubernetes CronJob schedule field: standard 5-field syntax
AWS EventBridge
cron(0/30 9-17 ? * MON-FRI *)   # AWS EventBridge: 6 fields incl. year, '?' required in one day field

Caveats & gotchas

  • Cron evaluates schedules in the server's local time zone; set CRON_TZ (cronie) or TZ (containers) explicitly on shared or distributed infrastructure.
  • Daylight saving transitions can shift, duplicate or skip wall-clock slots in local-time zones; scheduling in UTC removes the ambiguity.
  • Hour ranges are inclusive: 9-17 keeps firing until 17:59, which surprises people who expect the window to end at 17:00.
  • When both day-of-month and day-of-week are restricted, standard cron ORs them; keep one of the two as '*' unless you want that behavior.

Verify your schedule

After installing the schedule, verify it end to end instead of trusting the crontab line. Run 'crontab -l' to confirm the entry survived editing, then execute the command manually with the same user and environment to catch PATH and permission problems — cron runs with a minimal environment, so absolute paths and explicit SHELL/PATH declarations prevent the classic 'works in my terminal, fails in cron' bug. Watch the daemon log ('grep CRON /var/log/syslog' on Debian/Ubuntu, 'journalctl -u cron' or '-u crond' on systemd hosts) to confirm the trigger fires at the expected times, and redirect the job's own output to a log file with 2>&1 so failures are not swallowed by mail. Finally, cross-check the next run times listed on this page against your server's time zone before declaring the schedule correct.

Frequently asked questions

How do I run a cron job only during business hours?

Combine an hour range with a weekday range: */30 9-17 * * 1-5. Fields AND together, so the job fires only when minute, hour and weekday all match.

Does the hour range 9-17 include 17:30?

Yes — ranges are inclusive and the minute field still applies, so 9-17 covers everything up to 17:59. Use 9-16 if the window must end at 17:00 sharp.

Will this schedule run on public holidays?

Cron knows weekdays, not holidays. If holidays matter, keep the weekday schedule and add a holiday-calendar check at the top of the script.

Advertisement
Ad slot · ref-in-article

Try the Cron Parser

Decode cron schedules and preview the next run times.

Open tool →