Run Annual Christmas Day Jobs | CronBase
0 0 25 12 * Once a year on Christmas Day exactly at midnight
The `0 0 25 12 *` cron expression schedules a task to execute once a year at exactly midnight on December 25th. This highly specific interval is typically reserved for annual holiday automated tasks, system-wide maintenance during low-traffic periods, or specialized end-of-year data consolidation processes.
- Minute
- 0
- Hour
- 0
- Day of Month
- 25
- Month
- 12
- Day of Week
- *
Next 5 Runs
- in 152d 3h
- in 517d 3h
- in 883d 3h
- in 1248d 3h
- in 1613d 3h
* Tools
Code & Implementations
#!/usr/bin/env bash
set -euo pipefail
# Description: Annual Christmas Day maintenance wrapper
# This script should be installed in the crontab of the target user.
# Crontab entry:
# 0 0 25 12 * /usr/local/bin/annual-christmas-job.sh >> /var/log/cron/christmas.log 2>&1
LOG_FILE="/var/log/cron/christmas.log"
echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] Starting annual Christmas maintenance..."
# Ensure we have network connectivity or database access before proceeding
if ! ping -c 1 8.8.8.8 > /dev/null 2>&1; then
echo "[ERROR] No network connectivity. Aborting job." >&2
exit 1
fi
# Execute core workload
echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] Processing annual database archiving..."
# /usr/local/bin/archive-yearly-data.sh
echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] Annual job completed successfully." › Setup notes
Save the script to /usr/local/bin/annual-christmas-job.sh, make it executable with chmod +x, and add the entry 0 0 25 12 * /usr/local/bin/annual-christmas-job.sh to your system crontab using crontab -e.
const cron = require('node-cron');
const { exec } = require('child_process');
console.log('Initializing annual Christmas scheduler...');
// Schedule for: 0 0 25 12 *
// Minute: 0, Hour: 0, Day of Month: 25, Month: 12 (December), Day of Week: *
cron.schedule('0 0 25 12 *', () => {
console.log(`[${new Date().toISOString()}] Executing annual Christmas Day routine...`);
exec('/usr/local/bin/christmas-task.sh', (error, stdout, stderr) => {
if (error) {
console.error(`[ERROR] Execution failed: ${error.message}`);
return;
}
if (stderr) {
console.warn(`[WARN] Standard error output: ${stderr}`);
}
console.log(`[SUCCESS] Output: ${stdout}`);
});
}, {
scheduled: true,
timezone: "UTC"
}); › Setup notes
Install the node-cron package using npm install node-cron. Run this script using a process manager like PM2 to guarantee it remains running throughout the year.
import logging
import sys
from datetime import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def annual_holiday_job():
logger.info("Starting annual Christmas Day background processing...")
try:
# Simulate actual workload
logger.info("Executing database cleanup and holiday state migration.")
except Exception as e:
logger.error(f"Critical failure during annual job execution: {str(e)}")
sys.exit(1)
if __name__ == "__main__":
scheduler = BlockingScheduler()
# Standard cron fields: minute, hour, day, month, day_of_week
scheduler.add_job(
annual_holiday_job,
'cron',
month=12,
day=25,
hour=0,
minute=0,
timezone='UTC'
)
logger.info("Scheduler started. Waiting for December 25th...")
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
logger.info("Scheduler stopped manually.") › Setup notes
Install APScheduler using pip install apscheduler. Run this script inside a persistent background service (e.g., systemd service) so it daemonizes properly.
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.LUTC)
logger.Println("Initializing annual Christmas cron scheduler...")
// Use UTC for standard global synchronization
c := cron.New(cron.WithLocation(time.UTC))
// Standard cron spec: 0 0 25 12 *
_, err := c.AddFunc("0 0 25 12 *", func() {
logger.Println("Executing annual Christmas task...")
performMaintenance(logger)
})
if err != nil {
logger.Fatalf("Failed to schedule job: %v", err)
}
c.Start()
defer c.Stop()
// Handle graceful shutdown
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
<-sigChan
logger.Println("Shutting down cron engine gracefully...")
}
func performMaintenance(logger *log.Logger) {
// Workload logic goes here
logger.Println("Yearly maintenance complete.")
} › Setup notes
Initialize a Go module, install robfig/cron v3 via go get github.com/robfig/cron/v3, compile, and deploy the binary to your server.
package com.cronbase.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 ChristmasJobScheduler {
private static final Logger logger = LoggerFactory.getLogger(ChristmasJobScheduler.class);
// Cron format: second minute hour day-of-month month day-of-week
// Standard Spring cron adds the seconds field at the start.
@Scheduled(cron = "0 0 0 25 12 *", zone = "UTC")
public void executeChristmasTask() {
logger.info("Starting annual Christmas Day process at: {}", Instant.now());
try {
processYearlyArchive();
logger.info("Annual Christmas Day process finished successfully.");
} catch (Exception e) {
logger.error("Fatal error during annual Christmas cron execution", e);
// Trigger external alerting mechanism here
}
}
private void processYearlyArchive() {
// Actual business logic here
}
} › Setup notes
Ensure your Spring Boot project has @EnableScheduling annotated on its main class. The @Scheduled annotation will automatically trigger the method once a year on December 25th.
apiVersion: batch/v1
kind: CronJob
metadata:
name: annual-christmas-job
namespace: production
spec:
schedule: "0 0 25 12 *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
spec:
containers:
- name: holiday-processor
image: alpine:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- "echo 'Starting Christmas Day process'; sleep 30; echo 'Finished successfully'"
restartPolicy: OnFailure › Setup notes
Save this manifest to christmas-cronjob.yaml and apply it to your cluster using kubectl apply -f christmas-cronjob.yaml. The job will spin up a transient pod every December 25th.
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 0 25 12 ? *) Systemd Timer
OnCalendar*-12-25 00:00:00
[Unit]
Description=Timer for cron expression: 0 0 25 12 *
[Timer]
OnCalendar=*-12-25 00:00:00
Persistent=true
[Install]
WantedBy=timers.target
Last verified:
Frequently Asked Questions
What happens if the server is offline exactly at midnight on December 25th?
Standard cron engines do not catch up or retry missed executions automatically. If your server is offline when midnight strikes on December 25th, the job will not run until the following year. To prevent this, use tools like anacron, Kubernetes CronJobs, or external monitoring engines like dead-man's snitches to alert you if the job was skipped.
How can I safely test a cron job scheduled to run only once a year?
Do not wait until Christmas to test this job. You can test the workload by temporarily modifying the cron pattern to a minute-based interval (e.g., `*/5 * * * *`) in a staging environment. Additionally, write unit tests that mock the system clock to December 25th to verify that date-dependent logic behaves correctly.
Does this schedule take daylight saving time (DST) adjustments into account?
Standard Linux system cron runs on the host machine's timezone. In December, most regions are on standard time, not daylight saving time. However, to avoid any unexpected scheduling shifts, it is highly recommended to configure your servers and application schedulers to run strictly in UTC.
Will this job conflict with normal daily backups or server maintenance?
Yes, it can. Because this job runs at midnight, it may collide with daily cron jobs (which also frequently default to midnight). To avoid CPU and database lock-ups, you should offset this holiday job (e.g., to 2:00 AM) or implement database transaction isolation to protect your daily operational pipelines.
How can I trigger this job manually if it fails on Christmas Day?
Your application should expose a secure administrative endpoint, a manual CLI command, or a Kubernetes job trigger (e.g., `kubectl create job --from=cronjob/annual-christmas-job manually-triggered-job`) so that operators can rerun the task manually on December 26th without waiting another year.
* Explore
Related expressions you might need
Last verified: