Every Saturday at Noon Cron Schedule | CronBase
0 12 * * 6 Every Saturday at noon
This cron expression triggers a task precisely at noon every Saturday. It is commonly used by system administrators and DevOps teams to execute weekly maintenance operations, generate weekly business intelligence reports, run deep database optimizations, or initiate full backups during typical weekend low-traffic periods when system load is minimal.
- Minute
- 0
- Hour
- 12
- Day of Month
- *
- Month
- *
- Day of Week
- 6
Next 5 Runs
- in 6d 15h
- in 13d 15h
- in 20d 15h
- in 27d 15h
- in 34d 15h
* Tools
Code & Implementations
#!/usr/bin/env bash
set -euo pipefail
# Define log file and lock file to prevent overlapping executions
LOG_FILE="/var/log/weekly_cleanup.log"
LOCK_FILE="/var/run/weekly_cleanup.lock"
exec 9>"$LOCK_FILE"
if ! flock -n 9; then
echo "Error: Another instance of the weekly cleanup is already running." >&2
exit 1
fi
echo "[$(date -u)] Starting weekly maintenance task..." >> "$LOG_FILE"
# Perform the maintenance work (e.g., clearing old temp files, rotating logs)
if /usr/local/bin/perform_maintenance.sh >> "$LOG_FILE" 2>&1; then
echo "[$(date -u)] Weekly maintenance completed successfully." >> "$LOG_FILE"
else
echo "[$(date -u)] Error: Weekly maintenance failed!" >> "$LOG_FILE"
exit 1
fi › Setup notes
Save this script as weekly_cleanup.sh, make it executable with chmod +x weekly_cleanup.sh, and add it to your system crontab using crontab -e.
const cron = require('node-cron');
const { exec } = require('child_process');
console.log('Initializing Saturday noon weekly cron scheduler...');
// Schedule task to run every Saturday at 12:00 PM
cron.schedule('0 12 * * 6', () => {
console.log(`[${new Date().toISOString()}] Starting scheduled weekly database backup...`);
exec('/usr/local/bin/backup_db.sh', (error, stdout, stderr) => {
if (error) {
console.error(`[ERROR] Weekly backup failed: ${error.message}`);
return;
}
if (stderr) {
console.warn(`[WARN] Backup completed with warnings: ${stderr}`);
}
console.log(`[SUCCESS] Weekly backup finished: ${stdout.trim()}`);
});
}, {
scheduled: true,
timezone: "UTC"
}); › Setup notes
Install the node-cron package using npm. Run this script using node scheduler.js. It uses an explicit UTC timezone configuration to prevent issues with daylight saving time changes.
import logging
import sys
from datetime import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
# Setup production logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s [%(levelname)s] %(message)s',
handlers=[logging.StreamHandler(sys.stdout)]
)
def run_weekly_data_pipeline():
logging.info("Starting weekly data pipeline synchronization...")
try:
# Simulate business logic execution
logging.info("Weekly data pipeline synchronized successfully.")
except Exception as e:
logging.error(f"Failed to execute weekly data pipeline: {str(e)}", exc_info=True)
if __name__ == "__main__":
scheduler = BlockingScheduler()
# 0 12 * * 6 maps to day_of_week='sat', hour=12, minute=0
scheduler.add_job(
run_weekly_data_pipeline,
'cron',
day_of_week='sat',
hour=12,
minute=0,
timezone='UTC',
id='weekly_pipeline_job'
)
logging.info("Scheduler started. Waiting for Saturday 12:00 PM UTC...")
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
logging.info("Scheduler stopped cleanly.") › Setup notes
Install the apscheduler package using pip. Run this script in a background process or as a systemd service. It is configured to run in the UTC timezone to maintain scheduling consistency.
package main
import (
"log"
"os"
"os/signal"
"syscall"
"time"
"github.com/robfig/cron/v3"
)
func main() {
logger := log.New(os.Stdout, "[CRON] ", log.LstdFlags|log.Lshortfile)
logger.Println("Initializing Saturday noon scheduler...")
c := cron.New(cron.WithLocation(time.UTC))
_, err := c.AddFunc("0 12 * * 6", func() {
logger.Println("Starting weekly audit report generation...")
err := generateWeeklyAuditReport()
if err != nil {
logger.Printf("ERROR: Weekly audit report failed: %v\n", err)
return
}
logger.Println("SUCCESS: Weekly audit report generated successfully.")
})
if err != nil {
logger.Fatalf("Failed to schedule cron job: %v", err)
return
}
c.Start()
defer c.Stop()
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
<-sigChan
logger.Println("Shutting down scheduler gracefully...")
}
func generateWeeklyAuditReport() error {
time.Sleep(2 * time.Second)
return nil
} › Setup notes
Initialize a Go module and fetch the robfig/cron package. Compile and run this program as a daemon or containerized service. It uses standard 5-field cron syntax with UTC timezone enforcement.
package com.cronbase.scheduler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class WeeklyMaintenanceScheduler {
private static final Logger logger = LoggerFactory.getLogger(WeeklyMaintenanceScheduler.class);
// Spring uses 6 fields: second, minute, hour, day of month, month, day of week.
@Scheduled(cron = "0 0 12 * * SAT", zone = "UTC")
public void executeWeeklyMaintenance() {
logger.info("Starting scheduled Saturday noon maintenance task...");
try {
performDatabaseMaintenance();
logger.info("Weekly maintenance completed successfully.");
} catch (Exception e) {
logger.error("Error occurred during weekly maintenance job: ", e);
}
}
private void performDatabaseMaintenance() throws Exception {
Thread.sleep(5000);
}
} › Setup notes
Add this component to a Spring Boot application. Make sure @EnableScheduling is declared on your main application configuration class. The scheduler uses Spring's 6-field cron syntax configured for UTC.
apiVersion: batch/v1
kind: CronJob
metadata:
name: weekly-database-vacuum
namespace: production
labels:
app: database-maintenance
tier: cron
spec:
schedule: "0 12 * * 6"
timeZone: "Etc/UTC"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
metadata:
labels:
app: database-maintenance
spec:
restartPolicy: OnFailure
containers:
- name: vacuum-worker
image: postgres:15-alpine
env:
- name: PGUSER
value: "postgres"
- name: PGDATABASE
value: "production_db"
- name: PGHOST
value: "postgres-service.production.svc.cluster.local"
command:
- /bin/sh
- -c
- |
echo "Starting database VACUUM ANALYZE..."
vacuumdb -h "$PGHOST" -U "$PGUSER" -d "$PGDATABASE" -z -v
echo "Vacuum completed successfully." › Setup notes
Apply this manifest to your cluster using kubectl apply -f cronjob.yaml. It uses the timeZone field (v1.27+) and a Forbid concurrency policy to guarantee that overlapping executions are blocked.
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 12 ? * 6 *) Systemd Timer
OnCalendarSat *-*-* 12:00:00
[Unit]
Description=Timer for cron expression: 0 12 * * 6
[Timer]
OnCalendar=Sat *-*-* 12:00:00
Persistent=true
[Install]
WantedBy=timers.target
Last verified:
Frequently Asked Questions
How does daylight saving time affect this Saturday 12 PM schedule?
If your system timezone is local, daylight saving time shifts can cause the execution hour to shift relative to UTC. To ensure consistent operations, configure your cron daemon or scheduler to run exclusively in UTC or use explicit timezone settings.
Does the number 6 in this expression represent Saturday or Friday?
In standard POSIX cron, 0 represents Sunday and 6 represents Saturday. Some modern schedulers and dialects also allow 7 for Sunday, but 6 universally evaluates to Saturday across standard implementations.
What happens if the system is powered off on Saturday at noon?
Standard cron does not catch up on missed executions. If your server is offline at 12:00 PM on Saturday, the task will not run until the following Saturday. Use a tool like 'anacron' or a queue-based scheduler if catch-up execution is required.
How can I prevent multiple instances of this weekly task from overlapping?
While a weekly interval makes overlaps rare, long-running tasks can still hang. Use a distributed locking library (like Redis-based Redlock), a file-system lock using 'flock' in Bash, or set the Kubernetes 'concurrencyPolicy' to 'Forbid'.
Is Saturday noon a safe time to run heavy database maintenance?
This depends heavily on your business traffic profile. For B2B platforms, Saturday noon is typically a low-traffic valley. However, for B2C, retail, or entertainment apps, Saturday afternoon can be a peak traffic window. Always analyze your metrics first.
* Explore
Related expressions you might need
Last verified: