0 0 1 */4 * Cron Schedule Reference | CronBase

cron expression Standard
$ 0 0 1 */4 *

At midnight on the first day of every fourth month, specifically in January, May, and September.

This cron expression schedules a task to run at midnight on the first day of every fourth month. In standard cron environments, this translates to executing at 12:00 AM on January 1st, May 1st, and September 1st, providing a reliable triannual cadence for heavy maintenance and long-term data archiving.

Minute
0
Hour
0
Day of Month
1
Month
*/4
Day of Week
*
How it works

Next 5 Runs

  • in 37d 3h
  • in 159d 3h
  • in 279d 3h
  • in 402d 3h
  • in 524d 3h

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash
set -euo pipefail

# Production-grade script to safely install the triannual cron job
CRON_JOB="0 0 1 */4 * /usr/local/bin/triannual-cleanup.sh >> /var/log/cleanup.log 2>&1"

# Verify the target script exists before scheduling
if [ ! -f /usr/local/bin/triannual-cleanup.sh ]; then
    echo "Warning: Target script /usr/local/bin/triannual-cleanup.sh does not exist yet."
fi

# Check if the cron job already exists to prevent duplicate entries
if crontab -l 2>/dev/null | grep -Fq "/usr/local/bin/triannual-cleanup.sh"; then
    echo "Cron job already exists. Skipping deployment."
else
    (crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab -
    echo "Successfully scheduled triannual cleanup job in crontab."
fi
Setup notes

Save the code block as a shell script, make it executable with chmod +x, and run it with appropriate permissions to modify the crontab.

Last verified:

Partner BetterStack

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.

EventBridge Rule
cron(0 0 1 */4 ? *)

Systemd Timer

OnCalendar*-00/4-01 00:00:00

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

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

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

Which specific months will this cron expression execute in?

This schedule executes on the first day of January (month 1), May (month 5), and September (month 9). This is because the step value `*/4` starts at 1 and increments by 4.

How can I safely test a job that runs only once every four months?

Do not wait for the natural schedule. Test your code by triggering the execution script manually in a staging environment, or use tools to mock the system time to verify the scheduler behavior.

What timezone-related issues should I watch out for?

Standard cron runs on the host system's local time. If local time is used, transitions to and from Daylight Saving Time can shift the execution hour. Running servers in UTC mitigates this issue.

How should I set up monitoring for such an infrequent job?

Traditional threshold alerts are ineffective. Use an external monitoring service (a 'dead-man's switch') that expects a ping on the scheduled day, alerting you if that ping does not arrive within a specific window.

What happens if the host server is offline at midnight on the execution day?

Standard cron will miss the execution entirely and wait another four months. For critical jobs, use an orchestrator like Kubernetes with a `startingDeadlineSeconds` policy or systemd timers with persistent settings.

* Explore

Related expressions you might need

Last verified:

Was this helpful?