Quarterly Midnight Cleanups and Reports | CronBase

cron expression Standard
$ 0 0 1 */3 *

At midnight on the first day of every third month, starting in January.

This cron expression executes a task at midnight on the first day of every third month, initiating a quarterly schedule. It triggers at twelve AM on January first, April first, July first, and October first, providing a predictable cadence for financial reporting, automated data archiving, and long-term log rotation.

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

Next 5 Runs

  • in 19d 13h
  • in 111d 13h
  • in 201d 13h
  • in 292d 13h
  • in 384d 13h

* Tools

Code & Implementations

nodejs
const cron = require('node-cron');

// Schedule quarterly task: 0 0 1 */3 * (At midnight on the 1st of every 3rd month)
cron.schedule('0 0 1 */3 *', async () => {
    console.log(`[${new Date().toISOString()}] Starting quarterly data aggregation...`);
    try {
        await runQuarterlyAggregation();
        console.log(`[${new Date().toISOString()}] Quarterly aggregation completed successfully.`);
    } catch (error) {
        console.error(`[${new Date().toISOString()}] CRITICAL: Quarterly job failed:`, error);
        // Trigger alerting system here (e.g., PagerDuty, Sentry)
    }
});

async function runQuarterlyAggregation() {
    return new Promise((resolve) => setTimeout(resolve, 5000));
}
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 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 */3 ? *)

Systemd Timer

OnCalendar*-00/3-01 00:00:00

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

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

[Install]
WantedBy=timers.target

Frequently Asked Questions

Which months exactly does this quarterly cron schedule run?

This cron schedule runs on the first day of January, April, July, and October. These months correspond to the standard calendar quarters (Q1, Q2, Q3, and Q4).

What happens if my server is offline at midnight on the first day of the quarter?

Standard Linux cron will miss the execution entirely. For critical business tasks, you should use an orchestrator like Kubernetes CronJobs, Airflow, or a tool like anacron that catches up on missed runs.

How do I test this quarterly cron expression without waiting three months?

You can temporarily modify the expression to run in the next few minutes (e.g., '*/5 * * * *') in your staging environment to verify the script logic, or trigger the job manually via systemctl or kubectl.

Can I offset this to run at 2 AM instead of midnight to avoid peak traffic?

Yes, you can shift the time by changing the hour field. Modify the expression to '0 2 1 */3 *' to run at 2:00 AM on the first of the month, reducing resource contention.

Does standard cron support timezone-aware quarterly scheduling?

No, standard system cron uses the local timezone of the host operating system. To run based on a specific timezone, you must configure the server's timezone or use an application-level scheduler.

* Explore

Related expressions you might need

Was this helpful?

Last verified: