Annual New Year's Eve Cleanup
59 3 31 12 * Runs annually on December 31st at 3:59 AM.
* In a Nutshell
The cron expression 59 3 31 12 * runs Runs annually on December 31st at 3:59 AM.. This cron expression is ideal for executing critical annual maintenance tasks, such as generating year-end financial reports or performing a comprehensive system cleanup before the new year. It ensures that a specific, important task is executed precisely once a year on a predictable date.
* When to use this
Use 59 3 31 12 * when a recurring task needs to run Runs annually on December 31st at 3:59 AM.. This schedule is commonly associated with end of month and maintenance window and monthly schedules and report generation workloads. It uses Standard (5-Field POSIX) syntax, supported by Unix cron daemons, cloud schedulers such as AWS EventBridge, and container orchestration platforms such as Kubernetes CronJob.
CronBase parses 59 3 31 12 * using a dialect-aware rules engine that identifies the Standard (5-Field POSIX) format, validates field structure against the Standard (5-Field POSIX) specification, and produces the translation above. Next run times are calculated by forward-scanning from the current UTC clock. Learn how CronBase works.
Platform Implementations
Bash
Add '0 3 31 12 * /path/to/your/script.sh' to your crontab using 'crontab -e'.
0 3 31 12 * Last verified:
Nodejs
Use a library like 'node-cron' and specify the cron string: new CronJob('0 3 31 12 *', function() { /* task code */ }, null, true, 'America/Los_Angeles'); (Replace timezone as needed).
0 3 31 12 * Last verified:
Python
Utilize the 'schedule' library: schedule.every().day.at("03:59").tag('annual-task').run() # This requires custom logic to only run once a year, or use a scheduler that supports annual events.
0 3 31 12 * Last verified:
Golang
Use the 'robfig/cron' library: c := cron.New(); c.AddFunc("0 3 31 12 *", func() { /* task code */ }); c.Start()
0 3 31 12 * Last verified:
Java
Using Quartz Scheduler: SimpleTrigger trigger = new SimpleTrigger(); trigger.setCronExpression("0 3 31 12 * 2024"); // Specify year for annual execution. Alternatively, use a MonthlyJobListener approach.
0 3 31 12 * Last verified:
Kubernetes
Define a CronJob resource with the spec.schedule: "0 3 31 12 *".
0 3 31 12 * Last verified:
AWS EventBridge Equivalent
Standard cron expressions often need conversion for AWS EventBridge schedules.
cron(59 3 31 12 ? *) Frequently Asked Questions
What does this cron expression do?
This expression is configured to run a job exactly once a year, on December 31st, at 3:59 AM. It's commonly used for significant annual tasks like end-of-year reporting or system maintenance.
Does this expression account for time zones?
Cron expressions themselves do not inherently handle time zones. The execution time is relative to the server's or scheduler's configured time zone. For precise control across different regions, it's crucial to ensure the server's time zone is correctly set or to use a scheduling system that supports explicit time zone configurations.
How can I verify this cron is running correctly?
To verify, you can temporarily change the expression to a more frequent schedule (e.g., every minute for a few minutes) and monitor your logs. Ensure the job executes and then revert the expression to its original '59 3 31 12 *' to avoid unintended frequent executions.
What's a common variation of this schedule?
A common variation might be to run it at midnight on New Year's Day (e.g., '0 0 1 1 *') for tasks that should commence at the very start of the new year, or to run it at the end of the business day on December 31st if system availability is a concern.
What's a potential gotcha with this expression?
The primary gotcha is that 'December 31st' will not run in years where December doesn't have 31 days (which is never, as December always has 31 days). However, a more relevant gotcha is that if this expression were targeting, say, February 30th, it would never run. Always double-check that the day and month combination is valid.
More schedules like this
Explore End of Month →* Try any expression
Standard, Quartz, AWS EventBridge, Jenkins, named schedules (@daily, @hourly…)
* Keep Exploring