Run Weekly Friday Morning Jobs at 9 AM | CronBase
0 9 * * 5 Every Friday morning at nine o'clock
The `0 9 * * 5` cron expression schedules a task to run once a week every Friday morning at exactly 9:00 AM. This cadence is ideal for preparing end-of-week business reports, initiating pre-weekend system backups, or triggering weekly cleanup scripts before engineering teams sign off for the weekend.
- Minute
- 0
- Hour
- 9
- Day of Month
- *
- Month
- *
- Day of Week
- 5
Next 5 Runs
- in 5d 12h
- in 12d 12h
- in 19d 12h
- in 26d 12h
- in 33d 12h
* Tools
Code & Implementations
#!/usr/bin/env bash
# System crontab entry to run a weekly report script
# Add this line to /etc/cron.d/weekly-report or via 'crontab -e'
# 0 9 * * 5 /usr/local/bin/run-weekly-report.sh >> /var/log/weekly-report.log 2>&1
set -euo pipefail
LOCKFILE="/var/run/weekly-report.lock"
LOG_FILE="/var/log/weekly-report.log"
# Ensure only one instance runs
exec 9>"$LOCKFILE"
if ! flock -n 9; then
echo "[$(date '+$Y-%m-%d %H:%M:%S')] Script is already running. Exiting." >&2
exit 1
fi
echo "[$(date)] Starting Friday 9 AM weekly job..."
# Perform actual work here
if /usr/local/bin/generate-report-data; then
echo "[$(date)] Weekly job completed successfully."
else
echo "[$(date)] ERROR: Weekly job failed!" >&2
exit 1
fi › Setup notes
Place the bash script in a secure directory (e.g., /usr/local/bin/), make it executable using chmod +x, and add the cron definition 0 9 * * 5 /path/to/script.sh to your system's crontab.
const cron = require('node-cron');
const { exec } = require('child_process');
console.log('Registering Friday 9 AM weekly scheduler...');
// Schedule syntax: minute hour day-of-month month day-of-week
cron.schedule('0 9 * * 5', () => {
console.log(`[${new Date().toISOString()}] Initiating weekly Friday task...`);
exec('/usr/local/bin/friday-cleanup.sh', (error, stdout, stderr) => {
if (error) {
console.error(`[ERROR] Task failed: ${error.message}`);
return;
}
if (stderr) {
console.warn(`[WARN] Standard Error Output: ${stderr}`);
}
console.log(`[SUCCESS] Output: ${stdout}`);
});
}, {
scheduled: true,
timezone: "America/New_York"
}); › Setup notes
Install the node-cron package using npm install node-cron. Run this daemon process using a process manager like PM2 to guarantee uptime.
import logging
import sys
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.triggers.cron import CronTrigger
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s [%(levelname)s] %(message)s',
handlers=[logging.StreamHandler(sys.stdout)]
)
def trigger_weekly_pipeline():
logging.info("Starting Friday morning weekly data pipeline...")
try:
# Simulate business logic
logging.info("Pipeline execution completed successfully.")
except Exception as e:
logging.error(f"Pipeline crashed with exception: {str(e)}")
if __name__ == '__main__':
scheduler = BlockingScheduler()
# 0 9 * * 5 standard cron equivalency
trigger = CronTrigger(day_of_week='fri', hour=9, minute=0, timezone='UTC')
scheduler.add_job(trigger_weekly_pipeline, trigger=trigger, id='friday_9am_job')
logging.info("Scheduler started. Awaiting execution on Fridays at 09:00 UTC.")
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
logging.info("Scheduler stopped cleanly.") › Setup notes
Install APScheduler using pip install apscheduler. Run this script as a background service or within a Docker container.
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)
// Use NYC timezone specifically for localized 9 AM Friday execution
location, err := time.LoadLocation("America/New_York")
if err != nil {
logger.Fatalf("Failed to load timezone: %v", err)
}
c := cron.New(cron.WithLocation(location))
_, err = c.AddFunc("0 9 * * 5", func() {
logger.Println("Friday 9 AM job triggered. Starting operations...")
// Implement business logic here
logger.Println("Friday 9 AM job executed successfully.")
})
if err != nil {
logger.Fatalf("Error scheduling cron job: %v", err)
}
c.Start()
logger.Println("Cron engine initialized. Waiting for Friday 09:00 EST/EDT...")
// Wait for interrupt signal to gracefully shut down
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
<-sigChan
logger.Println("Stopping scheduler...")
c.Stop()
} › Setup notes
Initialize your Go module, fetch the v3 cron dependency with go get github.com/robfig/cron/v3, and run using go run main.go.
package com.example.scheduler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.time.Instant;
@Component
public class FridayWeeklyScheduler {
private static final Logger logger = LoggerFactory.getLogger(FridayWeeklyScheduler.class);
// Standard Spring cron syntax: second, minute, hour, day, month, day-of-week
// "0 0 9 * * FRI" executes at 09:00:00 AM every Friday
@Scheduled(cron = "0 0 9 * * FRI", zone = "Europe/London")
public void executeFridayMorningJob() {
logger.info("Triggered Friday weekly job at timestamp: {}", Instant.now());
try {
performMaintenanceTask();
logger.info("Friday weekly job finished successfully.");
} catch (Exception ex) {
logger.error("Critical error during Friday morning execution: ", ex);
}
}
private void performMaintenanceTask() {
// Actual business logic goes here
}
} › Setup notes
Ensure @EnableScheduling is added to your main Spring Boot Application class. The class containing the @Scheduled annotation must be managed as a Spring Bean (e.g., annotated with @Component).
apiVersion: batch/v1
kind: CronJob
metadata:
name: weekly-friday-cleanup
namespace: production
spec:
schedule: "0 9 * * 5"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
spec:
containers:
- name: worker
image: python:3.10-slim
command:
- python
- -c
- "print('Executing weekly Friday cleanup and sync tasks...')"
resources:
limits:
cpu: "500m"
memory: "512Mi"
requests:
cpu: "200m"
memory: "256Mi"
restartPolicy: OnFailure › Setup notes
Save the manifest configuration to friday-cronjob.yaml and apply it to your cluster with kubectl apply -f friday-cronjob.yaml.
Last verified:
Monitor this schedule in production
Get alerted the moment this cron job fails, is late, or doesn't run. BetterStack tracks execution, duration, and output — no infrastructure required.
Platform Equivalents
AWS EventBridge
Standard cron expressions often need conversion for AWS EventBridge schedules.
cron(0 9 ? * 5 *) Systemd Timer
OnCalendarFri *-*-* 09:00:00
[Unit]
Description=Timer for cron expression: 0 9 * * 5
[Timer]
OnCalendar=Fri *-*-* 09:00:00
Persistent=true
[Install]
WantedBy=timers.target
Last verified:
Frequently Asked Questions
How does daylight saving time affect this Friday 9 AM schedule?
Standard system cron daemons run on the host's local time. During DST transitions, 9:00 AM still occurs normally (unlike 2:00 AM transitions), but the absolute UTC offset changes, which can disrupt downstream systems synced to UTC.
What is the best way to handle failures for this weekly job?
Implement an external monitoring service (like Healthchecks.io or Opsgenie) using a 'dead man's switch' mechanism. If the job does not check in by 9:15 AM every Friday, trigger an immediate high-priority alert to the on-call engineer.
Can I run this job on both Fridays and Saturdays at 9 AM?
Yes, you can modify the day-of-week field to include Saturday by using a list or range. The expression `0 9 * * 5,6` or `0 9 * * 5-6` will trigger the execution at 9:00 AM on both Friday and Saturday.
How do I prevent multiple instances of this weekly cron from running simultaneously?
Wrap your script execution using a locking utility like `flock` in Linux, or use a distributed lock manager like Redis/ZooKeeper if running in a clustered environment. This ensures only one instance executes even if triggered manually.
Is 9:00 AM Friday a safe time to run heavy database migrations?
Generally, no. Friday morning is typically a peak business hour. Running resource-intensive migrations or heavy analytical queries during this time can degrade application performance. Such tasks should be scheduled for weekend maintenance windows instead.
* Explore
Related expressions you might need
Last verified: