Run Yearly Jobs on January 1st | CronBase

cron expression Standard
$ 0 0 1 1 *

At midnight on the first day of January every year

This standard cron expression schedules a task to run exactly once a year at midnight on January first. It is commonly utilized for annual system tasks such as generating year-end financial ledgers, archiving historical database records to cold storage, resetting yearly usage quotas, and executing major compliance audits across enterprise systems.

Minute
0
Hour
0
Day of Month
1
Month
1
Day of Week
*

Next 5 Runs

  • in 111d 13h
  • in 476d 13h
  • in 842d 13h
  • in 1207d 13h
  • in 1572d 13h

* Tools

Code & Implementations

nodejs
const cron = require('node-cron');
const { execYearlyArchival } = require('./tasks/archive');

// Schedule task for January 1st at midnight (00:00)
cron.schedule('0 0 1 1 *', async () => {
  console.log('Starting annual maintenance and archival process...');
  try {
    await execYearlyArchival();
    console.log('Annual archival completed successfully.');
  } catch (error) {
    console.error('CRITICAL: Annual archival failed:', error);
    // Trigger external alerting system (e.g., PagerDuty, Slack webhook)
  }
}, {
  timezone: "UTC"
});
Setup notes

Install node-cron using npm install node-cron, and run this script as a long-running background process using a process manager like PM2.

Partner UptimeRobot

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.

EventBridge Rule
cron(0 0 1 1 ? *)

Systemd Timer

OnCalendar*-01-01 00:00:00

my-task.timer
[Unit]
Description=Timer for cron expression: 0 0 1 1 *

[Timer]
OnCalendar=*-01-01 00:00:00
Persistent=true

[Install]
WantedBy=timers.target

Frequently Asked Questions

How do I test an annual cron job without waiting a full year?

You should design your application logic to be decoupled from the cron scheduler. Expose a secure, authenticated REST endpoint, CLI command, or invoke the execution function directly in a staging environment with mock data to verify behavior.

What happens to the job if a leap second occurs on December 31st?

Standard operating systems and modern NTP servers resolve leap seconds via 'slewing' (gradually adjusting the clock speed). The cron daemon relies on system time, so it will execute normally at midnight without missing the trigger.

How do I handle timezone transitions like Daylight Saving Time for this job?

Always run your cron daemon and schedule your annual jobs in UTC. Running in local timezones can cause the job to run twice or be skipped entirely if the local midnight transition coincides with a DST shift.

What is the best way to monitor a job that runs so infrequently?

Traditional passive monitoring (alerting on failure) is insufficient. Use a 'dead-man's switch' service (like Healthchecks.io or Opsgenie) that expects a ping within a specific window on January 1st and alerts if the ping is missed.

Can I use the @yearly shortcut instead of 0 0 1 1 *?

Yes, in standard Vixie cron and dialects like Kubernetes or Go's robfig/cron, @yearly and @annually are exact equivalents to 0 0 1 1 * and can be used to improve readability.

* Explore

Related expressions you might need

Was this helpful?

Last verified: