Schedule Weekly Monday Morning Tasks | CronBase

cron expression Standard
$ 0 7 * * 1

Every week on Monday morning at seven o'clock.

This cron expression schedules a task to run once a week on Monday mornings at exactly seven o'clock. It is commonly used by operations teams to trigger weekly database maintenance, generate weekly business intelligence reports, warm up application caches before the workweek starts, or dispatch weekly summary emails to users.

Minute
0
Hour
7
Day of Month
*
Month
*
Day of Week
1
How it works

Next 5 Runs

  • in 1d 10h
  • in 8d 10h
  • in 15d 10h
  • in 22d 10h
  • in 29d 10h

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash

# Exit immediately if a command exits with a non-zero status
set -euo pipefail

LOG_FILE="/var/log/weekly_backup.log"

echo "[$(date -u)] Starting weekly Monday morning maintenance..." >> "$LOG_FILE"

# Add your production-ready script logic here
if /usr/local/bin/run-database-backup --compress --upload-s3; then
    echo "[$(date -u)] Maintenance completed successfully." >> "$LOG_FILE"
else
    echo "[$(date -u)] ERROR: Maintenance failed! Sending alert..." >&2
    # Trigger alerting mechanism (e.g., PagerDuty, Slack webhook)
    exit 1
fi
Setup notes

Save this script to /usr/local/bin/weekly-maintenance.sh, make it executable with 'chmod +x', and add the following entry to your system crontab using 'crontab -e': 0 7 * * 1 /usr/local/bin/weekly-maintenance.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 7 ? * 1 *)

Systemd Timer

OnCalendarMon *-*-* 07:00:00

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

[Timer]
OnCalendar=Mon *-*-* 07:00:00
Persistent=true

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

How does Daylight Saving Time affect a Monday 7:00 AM cron job?

If your server runs on a timezone that observes DST, the job might run twice or be skipped during transition Sundays. To prevent this, run your servers and cron engines on UTC, which does not observe DST.

What happens if the server is offline at Monday 7:00 AM?

Standard cron does not retroactively run missed jobs. If your server is offline, the task is skipped until the next Monday. Use tools like anacron, systemd timers with Persistent=true, or Kubernetes CronJobs with startingDeadlineSeconds to handle offline recovery.

Is the day-of-week value 1 always interpreted as Monday?

Yes, in standard POSIX/Linux cron dialects, 1 represents Monday, and 7 or 0 represents Sunday. However, some systems like BSD or specific scheduler libraries might interpret 1 as Sunday. Always verify your specific scheduler's dialect documentation.

How can I test this cron schedule without waiting until Monday?

You can temporarily shift the cron expression to run a few minutes in the future (e.g., `*/5 * * * *`) to verify the script execution, or trigger the script manually directly from the command line while keeping the cron configuration intact.

Can I run this job on both Monday and Friday at 7:00 AM?

Yes, you can modify the day-of-week field to include multiple days using a comma. The expression `0 7 * * 1,5` will run the job at 7:00 AM on both Monday (1) and Friday (5).

* Explore

Related expressions you might need

Last verified:

Was this helpful?