Run Nightly Weekday Jobs at 10 PM | CronBase

cron expression Standard
$ 0 22 * * 1-5

Every night from Monday through Friday at ten o'clock in the evening.

The `0 22 * * 1-5` cron expression schedules a task to run automatically every weekday night, from Monday through Friday, precisely at 10:00 PM. It is commonly used in enterprise environments to trigger end-of-day database backups, synchronize transactional data, and clean up temporary storage volumes after business hours.

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

Next 5 Runs

  • in 2d 1h
  • in 3d 1h
  • in 4d 1h
  • in 5d 1h
  • in 6d 1h

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash
# Safe installation script for the weekday 10 PM cron job.
set -euo pipefail

# Define the cron command to execute safely
CRON_CMD="0 22 * * 1-5 /usr/local/bin/backup-job.sh >> /var/log/backup-job.log 2>&1"

# Verify script exists before registering
if [ ! -f "/usr/local/bin/backup-job.sh" ]; then
    echo "Error: Target script /usr/local/bin/backup-job.sh not found." >&2
    exit 1
fi

# Idempotently append to the crontab
(crontab -l 2>/dev/null | grep -Fv "/usr/local/bin/backup-job.sh"; echo "$CRON_CMD") | crontab -
echo "Cron job successfully scheduled for 22:00 Monday-Friday."
Setup notes

Save the script to a file named setup-cron.sh, make it executable using chmod +x setup-cron.sh, and run it as a user with appropriate crontab permissions.

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

Systemd Timer

OnCalendarMon..Fri *-*-* 22:00:00

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

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

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

How does Daylight Saving Time affect a 10 PM weekday cron job?

If your host OS or execution environment is set to local time (e.g., Eastern Time), the job will shift along with Daylight Saving Time transitions. This means it will always execute at 10:00 PM local time. If your system is set to UTC, the execution time relative to your local time will shift forward or backward by one hour twice a year. To prevent this, configure your scheduler or runner to target a specific timezone instead of falling back to UTC.

Can I use this expression to run jobs on weekends too?

No, this specific expression (`1-5` in the fifth field) restricts execution strictly to Monday through Friday. If you want to include weekends, you must change the fifth field to `0-6` (or `*`), which would schedule the task to run every single night of the week at 10:00 PM.

What happens if a weekday holiday falls on one of these run times?

Standard cron engines do not possess holiday awareness; they will execute the scheduled task on holidays if they fall on a weekday. To prevent executions on corporate holidays, you must write program logic inside your application or wrapper script to check a holiday calendar API or database and gracefully exit early.

How can I prevent overlapping runs if a Friday job takes over 24 hours?

To prevent concurrent execution overlaps, you must implement a locking mechanism. In Kubernetes, you can set `concurrencyPolicy: Forbid`. In custom environments, use file locks via `flock` or distributed locks via Redis or Consul to ensure that if a previous night's job is still active, the new run terminates immediately.

Why is my task running at 5 PM instead of 10 PM?

This is almost always a timezone mismatch. Your system or application daemon is likely running on UTC time, which makes 10:00 PM UTC correspond to 5:00 PM EST or 6:00 PM EDT. To fix this, change the server's system timezone to your local timezone, or use a scheduling library (like APScheduler or Spring) that explicitly supports timezone overrides.

* Explore

Related expressions you might need

Last verified:

Was this helpful?