Run Hourly Tasks During Business Hours | CronBase

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

Hourly on the hour during standard business hours from Monday through Friday.

The `0 9-17 * * 1-5` cron expression triggers a task at the top of every hour from 9:00 AM to 5:00 PM, Monday through Friday. It is designed to automate operational processes, system health checks, and data synchronizations exclusively during standard corporate business hours.

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

Next 5 Runs

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

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash
# Production wrapper script for running tasks hourly during business hours
set -euo pipefail

LOCKFILE="/var/lock/business_hourly_job.lock"
exec 9>"$LOCKFILE"

# Acquire an exclusive lock to prevent overlapping runs
if ! flock -n 9; then
    echo "Error: Another instance of the job is currently running." >&2
    exit 1
fi

echo "[$(date -u)] Starting business hours hourly synchronization..."
# Execute the actual workload here
# /usr/local/bin/sync-data.sh

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

Save this script to your server, make it executable with chmod +x, and register it in your crontab using 0 9-17 * * 1-5 /path/to/script.sh.

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 9-17 ? * 1-5 *)

Systemd Timer

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

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

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

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

How does timezone configuration affect this business-hours schedule?

By default, standard cron operates on the host system's timezone (often UTC). If your business operates in a different timezone, you must adjust the hour range in the expression or configure your cron daemon (such as systemd-cron or Kubernetes cronjob timezone) to match your local business hours.

What happens if a task runs longer than one hour?

If a task takes longer than 60 minutes, the next scheduled instance will start while the previous one is still running. To prevent this overlap, implement locking mechanisms like flock in Bash, or use singleton execution patterns in your application code.

Does this expression run at exactly 5:00 PM?

Yes, the range '9-17' is inclusive. The task will execute at 9:00 AM, hourly throughout the day, with the final execution of the day occurring at exactly 5:00 PM (17:00). It will not run at 5:01 PM or later.

How can I add a randomized delay to prevent server spikes?

You can introduce a random sleep command at the start of your execution. In Bash, using `sleep $((RANDOM % 60))` delays the start by up to one minute, smoothing out resource consumption across multiple concurrent jobs.

Why is my Kubernetes CronJob not triggering on this schedule?

Ensure your Kubernetes cluster controller-manager is configured with the correct timezone, or use the `spec.timeZone` field (available in Kubernetes 1.27+) to explicitly define the timezone for your CronJob manifest.

* Explore

Related expressions you might need

Last verified:

Was this helpful?