Every 5 Minutes on Weekdays Cron Schedule | CronBase

cron expression Standard
$ */5 * * * 1-5

Every five minutes on weekdays

This cron expression schedules a task to run every five minutes, but only on weekdays from Monday through Friday. It is ideal for continuous monitoring, high-frequency data ingestion, and API polling during standard business days, ensuring operations pause automatically over the weekend to reduce unnecessary cloud infrastructure costs.

Minute
*/5
Hour
*
Day of Month
*
Month
*
Day of Week
1-5
How it works

Next 5 Runs

  • in 1d 3h
  • in 1d 3h
  • in 1d 3h
  • in 1d 3h
  • in 1d 3h

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash

# Production Bash execution wrapper for standard cron
# Cron entry: */5 * * * 1-5 /usr/local/bin/weekday_sync.sh >> /var/log/cron_sync.log 2>&1

set -euo pipefail

LOCKFILE="/var/run/weekday_sync.lock"
TIMEOUT_SECONDS=280 # Exit before the next 5-minute invocation

# Ensure only one instance runs at a time using flock
exec 9>>"$LOCKFILE"
if ! flock -n 9; then
    echo "[$(date -u '+\%Y-\%m-\%dT\%H:\%M:\%SZ')] Warning: Previous execution is still running. Exiting to prevent overlap."
    exit 0
fi

# Execute actual payload with a timeout
echo "[$(date -u '+\%Y-\%m-\%dT\%H:\%M:\%SZ')] Starting weekday synchronization..."
timeout "$TIMEOUT_SECONDS" curl -fsS --retry 3 https://api.internal.service/v1/sync || {
    echo "[$(date -u '+\%Y-\%m-\%dT\%H:\%M:\%SZ')] Error: Sync failed or timed out."
    exit 1
}

echo "[$(date -u '+\%Y-\%m-\%dT\%H:\%M:\%SZ')] Sync completed successfully."
Setup notes

Save this script as /usr/local/bin/weekday_sync.sh, make it executable with chmod +x, and add */5 * * * 1-5 /usr/local/bin/weekday_sync.sh >> /var/log/cron_sync.log 2>&1 to your system 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(*/5 * ? * 1-5 *)

Systemd Timer

OnCalendarMon..Fri *-*-* *:00/5:00

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

[Timer]
OnCalendar=Mon..Fri *-*-* *:00/5:00
Persistent=true

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

How do I prevent overlapping executions if a run takes longer than 5 minutes?

You should implement a locking mechanism such as Redis-based distributed locks, database-level flags, or file-based locks (`flock` in Linux). In Kubernetes, configure `concurrencyPolicy: Forbid` to automatically skip execution if the previous pod is still active.

What happens to the schedule during daylight saving time (DST) changes?

If your server timezone is set to a region that observes DST, the execution times will shift relative to UTC. To maintain a consistent 5-minute interval without interruption or double-execution during the fallback hour, it is highly recommended to run your cron daemon on UTC.

How can I handle the massive backlog accumulated over the weekend on Monday morning?

Design your worker to process data in small, deterministic batches rather than attempting to ingest all weekend data in a single run. Use cursor-based pagination and implement rate-limiting or backpressure to protect downstream APIs and databases from being overwhelmed.

Why does my weekday cron start running on Sunday afternoon in my local timezone?

This occurs because your cron daemon is running in UTC. Monday 00:00 UTC corresponds to Sunday evening in Western time zones (e.g., 7:00 PM EST). To fix this, you must either configure your cron environment to use your local timezone or shift the hour and day-of-week fields to compensate.

Can I exclude specific holidays that fall on weekdays from this schedule?

Standard cron syntax does not support holiday calendars. To bypass holidays, you must implement application-level logic at the beginning of your script to check the current date against a holiday list (e.g., using a library or database table) and exit early if a match is found.

* Explore

Related expressions you might need

Last verified:

Was this helpful?