Run Weekly Saturday Maintenance | CronBase
0 3 * * 6 Every Saturday morning at three o'clock
The `0 3 * * 6` cron expression schedules a task to run weekly every Saturday morning at exactly 3:00 AM. This weekend timing is highly popular for resource-intensive jobs like database optimizations, full system backups, and batch reporting, as it minimizes performance impact on standard business-hour operations.
- Minute
- 0
- Hour
- 3
- Day of Month
- *
- Month
- *
- Day of Week
- 6
Next 5 Runs
- in 6d 6h
- in 13d 6h
- in 20d 6h
- in 27d 6h
- in 34d 6h
* Tools
Code & Implementations
#!/bin/bash\n# Script to install the weekly Saturday 3 AM cron job safely\nCRON_JOB=\"0 3 * * 6 /usr/local/bin/weekly-backup.sh >> /var/log/backup.log 2>&1\"\n(crontab -l 2>/dev/null | grep -Fq \"$CRON_JOB\") || (crontab -l 2>/dev/null; echo \"$CRON_JOB\") | crontab -\necho \"Successfully registered Saturday weekly maintenance task.\" › Setup notes
Save the script to a file, make it executable using 'chmod +x', and run it to register the backup schedule in the current user's crontab.
const cron = require('node-cron');\n\n// Schedule task to run weekly on Saturday at 3:00 AM\ncron.schedule('0 3 * * 6', () => {\n console.log('Starting weekly system maintenance tasks...');\n try {\n // Place your backup or maintenance logic here\n } catch (error) {\n console.error('Weekly maintenance failed:', error);\n }\n}, {\n scheduled: true,\n timezone: \"UTC\"\n}); › Setup notes
Install node-cron via npm install node-cron. This code initializes a background listener using the UTC timezone to avoid DST calculation errors.
from apscheduler.schedulers.blocking import BlockingScheduler\nimport logging\n\nlogging.basicConfig(level=logging.INFO)\nscheduler = BlockingScheduler(timezone=\"UTC\")\n\n# Runs every Saturday at 3:00 AM\n@scheduler.scheduled_job('cron', day_of_week='sat', hour=3, minute=0)\ndef weekly_maintenance():\n logging.info(\"Executing scheduled weekly Saturday maintenance job.\")\n try:\n # Execution logic goes here\n pass\n except Exception as e:\n logging.error(f\"Maintenance job failed: {e}\")\n\nif __name__ == \"__main__\":\n scheduler.start() › Setup notes
Install apscheduler via pip. This script runs a blocking scheduler that triggers your maintenance logic on the exact Saturday cycle.
package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/robfig/cron/v3\"\n)\n\nfunc main() {\n\t// Use UTC to avoid DST transition complexities at 3:00 AM\n\tnyc, err := time.LoadLocation(\"UTC\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to load timezone: %v\", err)\n\t}\n\n\tc := cron.New(cron.WithLocation(nyc))\n\t_, err = c.AddFunc(\"0 3 * * 6\", func() {\n\t\tfmt.Println(\"Running weekly Saturday system maintenance task...\")\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"Error scheduling cron job: %v\", err)\n\t}\n\n\tc.Start()\n\tselect {} // Keep the application running\n} › Setup notes
Run 'go get github.com/robfig/cron/v3' to fetch the library, then execute this program as a long-running system daemon.
package com.example.cron;\n\nimport org.springframework.scheduling.annotation.Scheduled;\nimport org.springframework.stereotype.Component;\nimport java.util.logging.Logger;\n\n@Component\npublic class WeeklyMaintenanceScheduler {\n private static final Logger LOGGER = Logger.getLogger(WeeklyMaintenanceScheduler.class.getName());\n\n // Spring cron: second, minute, hour, day of month, month, day(s) of week\n // 0 0 3 * * SAT translates to 3:00 AM every Saturday\n @Scheduled(cron = \"0 0 3 * * SAT\", zone = \"UTC\")\n public void runWeeklyBackup() {\n LOGGER.info(\"Starting scheduled weekly Saturday maintenance...\");\n try {\n // Maintenance implementation goes here\n } catch (Exception e) {\n LOGGER.severe(\"Failed to execute weekly backup: \" + e.getMessage());\n }\n }\n} › Setup notes
Ensure @EnableScheduling is active in your Spring Boot application configuration. This job runs on the Saturday schedule in UTC.
apiVersion: batch/v1\nkind: CronJob\nmetadata:\n name: weekly-saturday-maintenance\n namespace: infrastructure\nspec:\n schedule: \"0 3 * * 6\"\n concurrencyPolicy: Forbid\n successfulJobsHistoryLimit: 3\n failedJobsHistoryLimit: 5\n jobTemplate:\n spec:\n template:\n spec:\n containers:\n - name: maintenance-worker\n image: backup-utility:latest\n command: [\"/bin/sh\", \"-c\", \"/app/run-maintenance.sh\"]\n restartPolicy: OnFailure › Setup notes
Apply this manifest using 'kubectl apply -f'. The concurrencyPolicy is set to Forbid to prevent multiple instances from running concurrently if a job hangs.
Last verified:
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.
cron(0 3 ? * 6 *) Systemd Timer
OnCalendarSat *-*-* 03:00:00
[Unit]
Description=Timer for cron expression: 0 3 * * 6
[Timer]
OnCalendar=Sat *-*-* 03:00:00
Persistent=true
[Install]
WantedBy=timers.target
Last verified:
Frequently Asked Questions
How does Daylight Saving Time affect this Saturday 3 AM schedule?
Depending on your local timezone, the transition to or from Daylight Saving Time can cause this job to execute twice or skip entirely. Running your servers on UTC prevents this variance completely.
Can I run this on both Saturday and Sunday at the same time?
Yes, you can modify the day-of-week field to include Sunday. In standard cron, the expression `0 3 * * 6,0` (or `6,7` depending on environment) will run at 3:00 AM on both weekend days.
What happens if the host server is offline at Saturday 3:00 AM?
Standard cron daemons will not retroactively run missed jobs once the server boots back up. If you require execution recovery, consider using anacron or systemd timers with persistent storage enabled.
How should I monitor a weekly job to ensure it actually executed?
Because this job runs weekly, passive monitoring is risky. Use active heartbeat monitoring (like Uptime Kuma or Cronitor) where the job sends a ping upon completion, alerting you if no ping is received.
Is it safe to run heavy database vacuuming at this specific time?
Yes, Saturday at 3:00 AM is generally the lowest traffic window for most business systems. However, ensure that backup processes do not overlap with vacuuming to avoid severe disk I/O bottlenecks.
* Explore
Related expressions you might need
Last verified: