Run Hourly Tasks During Business Hours | CronBase

cron expression Standard
$ 0 8-17 * * 1-5

Every hour on the hour during standard daytime business hours on weekdays.

This cron expression executes a task at the beginning of every hour from 8:00 AM to 5:00 PM, Monday through Friday. It is designed to align automated operations with standard corporate working hours, making it perfect for office-hour data synchronization, system health checks, and transactional queue processing.

Minute
0
Hour
8-17
Day of Month
*
Month
*
Day of Week
1-5
How it works

Next 5 Runs

  • in 1d 11h
  • in 1d 12h
  • in 1d 13h
  • in 1d 14h
  • in 1d 15h

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash
# Production-ready wrapper for hourly business tasks
set -euo pipefail

LOCKFILE="/var/lock/business-hourly-sync.lock"
# Prevent concurrent execution if a previous run hangs
exec 9>"$LOCKFILE"
if ! flock -n 9; then
    echo "Error: Another instance of this job is already running." >&2
    exit 1
fi

echo "[$(date -u)] Starting business hours sync..."
# Execute actual task
/usr/local/bin/sync-erp-data.sh --verbose

echo "[$(date -u)] Sync completed successfully."
Setup notes

Save this script as /usr/local/bin/run-hourly-sync.sh, make it executable with chmod +x, and add '0 8-17 * * 1-5 /usr/local/bin/run-hourly-sync.sh' to your crontab.

Last verified:

Partner UptimeRobot

Keep this cron job monitored 24/7

UptimeRobot alerts you the moment a scheduled job stops responding. Free plan monitors up to 50 endpoints — no credit card required.

Platform Equivalents

AWS EventBridge

Standard cron expressions often need conversion for AWS EventBridge schedules.

EventBridge Rule
cron(0 8-17 ? * 1-5 *)

Systemd Timer

OnCalendarMon..Fri *-*-* 08..17:00:00

my-task.timer
[Unit]
Description=Timer for cron expression: 0 8-17 * * 1-5

[Timer]
OnCalendar=Mon..Fri *-*-* 08..17:00:00
Persistent=true

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

How does timezone configuration affect this schedule?

If your system timezone is set to UTC, the schedule will execute at UTC hours. For a US East Coast business, this runs from 3:00 AM to 12:00 PM EST, which is likely incorrect. Always explicitly set your scheduler's timezone to the business location's timezone to ensure compliance with local business hours and automatic adjustments for Daylight Saving Time (DST).

What happens if a job execution exceeds one hour?

Because the job triggers every hour, an execution taking longer than 60 minutes will cause overlapping runs. To prevent resource contention and database lockups, implement concurrency locking mechanisms like flock in Bash, Kubernetes concurrencyPolicy: Forbid, or distributed locks (e.g., Redis-based Redlock) in application code.

Does this schedule run on weekends or public holidays?

The 1-5 day-of-week restriction ensures the job only runs Monday through Friday. Standard cron, however, is unaware of public holidays. If your business tasks should not execute on holidays, you must implement a calendar lookup check within your application logic to skip execution on those specific dates.

Why is my job running twice during Daylight Saving Time transitions?

Standard cron daemons that run on local server time can execute jobs twice when the clock falls back, or skip them when it springs forward. To prevent this, configure your cron engine to use UTC, or use modern orchestration tools (like Kubernetes CronJobs or Spring Scheduler) that natively handle timezone transitions and DST boundaries.

How can I test this cron schedule locally without waiting for weekdays?

You can simulate cron execution locally by parsing the expression using command-line tools like cron-eval or programmatic libraries like Python's croniter. For end-to-end integration testing, temporarily change the cron schedule to run every minute (* * * * *) or manually trigger the target script/endpoint directly.

* Explore

Related expressions you might need

Last verified:

Was this helpful?