Execute Every Friday Evening at 6:30 PM | CronBase
30 18 * * 5 Every Friday evening at half past six.
The `30 18 * * 5` cron expression schedules a task to run once a week on Friday evenings at exactly 6:30 PM. This cadence is ideal for executing end-of-week processes, system backups, or compiling weekly business intelligence reports before the weekend starts.
- Minute
- 30
- Hour
- 18
- Day of Month
- *
- Month
- *
- Day of Week
- 5
Next 5 Runs
- in 5d 22h
- in 12d 22h
- in 19d 22h
- in 26d 22h
- in 33d 22h
* Tools
Code & Implementations
#!/usr/bin/env bash
# Add this line to your crontab using 'crontab -e'
# 30 18 * * 5 /usr/local/bin/weekly_cleanup.sh >> /var/log/weekly_cleanup.log 2>&1
set -euo pipefail
LOG_FILE="/var/log/weekly_cleanup.log"
echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] Starting Friday evening maintenance..." >> "$LOG_FILE"
# Execute your production task here
if /usr/local/bin/perform_backup; then
echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] Maintenance completed successfully." >> "$LOG_FILE"
else
echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] ERROR: Maintenance failed!" >> "$LOG_FILE"
exit 1
fi › Setup notes
Save the script to /usr/local/bin/weekly_cleanup.sh, make it executable with chmod +x, and append the cron schedule to your system crontab.
const cron = require('node-cron');
const { exec } = require('child_process');
// Schedule task to run every Friday at 18:30 (6:30 PM)
cron.schedule('30 18 * * 5', () => {
console.log(`[${new Date().toISOString()}] Initiating Friday weekly sync...`);
exec('/usr/local/bin/sync-script.sh', (error, stdout, stderr) => {
if (error) {
console.error(`Execution error: ${error.message}`);
return;
}
if (stderr) {
console.warn(`Standard error output: ${stderr}`);
}
console.log(`Execution output: ${stdout}`);
});
}, {
scheduled: true,
timezone: "Etc/UTC"
}); › Setup notes
Install node-cron using 'npm install node-cron' and run this script using a process manager like PM2 to ensure high availability.
import logging
from apscheduler.schedulers.blocking import BlockingScheduler
logging.basicConfig(level=logging.INFO,
format='%(asctime)s [%(levelname)s] %(message)s')
def run_friday_job():
logging.info("Starting Friday evening batch processing...")
try:
# Place production workload logic here
pass
except Exception as e:
logging.error(f"Job failed with exception: {str(e)}")
scheduler = BlockingScheduler(timezone="UTC")
# 30 18 * * 5 maps to day_of_week='fri', hour=18, minute=30
scheduler.add_job(run_friday_job, 'cron', day_of_week='fri', hour=18, minute=30)
try:
logging.info("Scheduler started. Waiting for Friday 18:30 UTC...")
scheduler.start()
except (KeyboardInterrupt, SystemExit):
logging.info("Scheduler shut down successfully.") › Setup notes
Install APScheduler using 'pip install APScheduler' and run the python file as a background daemon process.
package main
import (
"fmt"
"log"
"time"
"github.com/robfig/cron/v3"
)
func main() {
// Use UTC timezone to prevent daylight saving shifts
loc, err := time.LoadLocation("UTC")
if err != nil {
log.Fatalf("Failed to load UTC timezone: %v", err)
}
c := cron.New(cron.WithLocation(loc))
_, err = c.AddFunc("30 18 * * 5", func() {
fmt.Printf("[%s] Executing Friday weekly backup pipeline...\n", time.Now().UTC().Format(time.RFC3339))
// Implement business logic here
})
if err != nil {
log.Fatalf("Error scheduling cron job: %v", err)
}
c.Start()
select {} // Block main thread indefinitely
} › Setup notes
Initialize a Go module, run 'go get github.com/robfig/cron/v3', then build and run the executable.
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.time.Instant;
import java.util.logging.Logger;
@Component
public class FridayMaintenanceScheduler {
private static final Logger LOGGER = Logger.getLogger(FridayMaintenanceScheduler.class.getName());
// 30 18 * * 5 translates to "30 18 * * FRI" in Spring's cron dialect
@Scheduled(cron = "0 30 18 * * FRI", zone = "UTC")
public void executeFridayTasks() {
LOGGER.info("Friday evening task triggered at: " + Instant.now().toString());
try {
// Production task execution goes here
} catch (Exception e) {
LOGGER.severe("Critical failure during Friday task execution: " + e.getMessage());
}
}
} › Setup notes
Enable scheduling in your Spring Boot application by adding @EnableScheduling to your main configuration class.
apiVersion: batch/v1
kind: CronJob
metadata:
name: friday-cleanup-job
namespace: production
spec:
schedule: "30 18 * * 5"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
spec:
containers:
- name: worker
image: busybox:1.36
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- "echo Starting weekly database maintenance... && sleep 30"
restartPolicy: OnFailure › Setup notes
Apply this manifest to your cluster using 'kubectl apply -f cronjob.yaml'. Ensure your cluster timezone matches your operational expectations.
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(30 18 ? * 5 *) Systemd Timer
OnCalendarFri *-*-* 18:30:00
[Unit]
Description=Timer for cron expression: 30 18 * * 5
[Timer]
OnCalendar=Fri *-*-* 18:30:00
Persistent=true
[Install]
WantedBy=timers.target
Last verified:
Frequently Asked Questions
How does daylight saving time affect this Friday 6:30 PM schedule?
Standard cron daemons run on system time. If your server is set to a local timezone that observes DST, the execution will shift relative to UTC twice a year. To prevent this, configure your servers or cron runners to use UTC exclusively.
What happens if the server is offline at 18:30 on Friday?
Standard cron does not catch up on missed executions. If your system is offline during the scheduled time, the task will not run until the following Friday. Use tools like anacron or robust queuing engines if missed-run execution is critical.
Can I run this job on both Thursday and Friday evenings?
Yes, you can modify the day-of-week field to include multiple days. Changing the expression to `30 18 * * 4,5` will execute the task at 6:30 PM on both Thursday and Friday.
Is 5 always interpreted as Friday across all cron engines?
In standard UNIX cron and most modern engines like systemd, Kubernetes, and robfig/cron, 5 represents Friday (with 0 or 7 as Sunday). However, always verify your specific environment's dialect, as some non-standard schedulers may use different indexing.
How should I handle on-call alerts for failures on Friday evening?
Since this job executes at 6:30 PM on Friday, failures may occur outside normal business hours. Ensure your alerting system (like PagerDuty) routes notifications to the designated weekend on-call engineer rather than the weekday team.
* Explore
Related expressions you might need
Last verified: