Cron job once a year

To run a cron job once a year, use 0 0 1 1 *. At 00:00 on the 1st of the month in January.

  • Free
  • No Sign-Up
  • Runs in Your Browser

Runs

Next Runs

Your time zone
Friday1 Jan 2027, 00:00
Saturday1 Jan 2028, 00:00
Monday1 Jan 2029, 00:00
Tuesday1 Jan 2030, 00:00
Wednesday1 Jan 2031, 00:00

Crontab Line

0 0 1 1 * /path/to/job.sh >> /var/log/cron-job.log 2>&1

Cron Expression Generator

0 0 1 1 * explained

Expression0 0 1 1 *
MeaningAt 00:00 on the 1st of the month in January
Runs per Week0
Crontab Line0 0 1 1 * /path/to/job.sh
systemd OnCalendaryearly
Time ZoneThe server's, unless CRON_TZ is set

Cron checks the schedule once a minute and starts the job at the start of each matching minute, in the server's time zone.

If a run can take longer than the gap between runs, stop runs overlapping with flock: 0 0 1 1 * flock -n /tmp/job.lock /path/to/job.sh. A second copy then exits straight away instead of piling up.

Cron runs jobs with a minimal environment: use full paths, and send output to a log file (>> /var/log/job.log 2>&1) so errors are not lost.

Questions

How do I run a cron job once a year?
Run crontab -e and add: 0 0 1 1 * /path/to/job.sh
How do I check the cron job ran?
Look in the job's own log if it writes one, or the system log: grep CRON /var/log/syslog on Debian and Ubuntu, or journalctl -u cron (cron.service is crond on RHEL).
What is the systemd timer equivalent of 0 0 1 1 *?
OnCalendar=yearly in a .timer unit. systemd timers can also catch up on missed runs with Persistent=true.

Run servers for other people?

Frabs stops the abuse their VMs send out, and keeps your network off blocklists.