Run Daily Maintenance at 1:30 AM | CronBase

cron expression Standard
$ 30 1 * * *

At half past one in the morning every single day

This cron expression schedules a task to execute automatically every day at exactly 1:30 AM. It is widely used in production environments for off-peak operations such as database backups, log rotation, clearing temporary caches, and synchronizing daily analytical data when user activity and system load are at their lowest.

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

Next 5 Runs

  • in 15h 33m
  • in 1d 15h
  • in 2d 15h
  • in 3d 15h
  • in 4d 15h

* Tools

Code & Implementations

nodejs
const cron = require('node-cron');
const { exec } = require('child_process');

// Schedule task to run daily at 1:30 AM in UTC
cron.schedule('30 1 * * *', () => {
    console.log(`[${new Date().toISOString()}] Initiating daily database backup...`);
    try {
        exec('/usr/local/bin/backup-db.sh', (error, stdout, stderr) => {
            if (error) {
                console.error(`Backup execution error: ${error.message}`);
                return;
            }
            if (stderr) {
                console.warn(`Backup process warning: ${stderr}`);
            }
            console.log(`Backup completed: ${stdout}`);
        });
    } catch (err) {
        console.error('Unexpected execution error during daily cron:', err);
    }
}, {
    scheduled: true,
    timezone: "UTC"
});
Setup notes

Install the node-cron library via npm, then execute this script as a long-running daemon process using PM2 or systemd.

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(30 1 * * ? *)

Systemd Timer

OnCalendar*-*-* 01:30:00

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

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

[Install]
WantedBy=timers.target

Frequently Asked Questions

How does Daylight Saving Time affect the 1:30 AM execution?

During DST transitions, the 1:30 AM slot can be tricky. When clocks spring forward, 1:30 AM is skipped in some local timezones, meaning your job might not run. When clocks fall back, it might execute twice. To avoid this, always run your system cron daemons in UTC.

Why should I schedule backups at 1:30 AM instead of midnight?

Midnight is the default target for many automated tasks, leading to severe resource contention, high CPU spikes, and network bottlenecks. Shifting your resource-heavy tasks to 1:30 AM isolates your workload from standard midnight rollups and ensures smoother execution.

How do I prevent a slow-running 1:30 AM job from overlapping?

Use a locking utility like `flock` in Linux or implement a distributed lock manager (like Redis-based Redlock) in your application. This ensures that if the previous day's execution is still running for over 24 hours, the new instance will safely abort.

Can I run this job only on weekdays using standard cron?

Yes, you can easily restrict this schedule to weekdays by changing the last field. Modifying the expression to `30 1 * * 1-5` will execute your task at 1:30 AM from Monday through Friday, skipping the weekend entirely.

How should I monitor if the 1:30 AM job failed to run?

Implement dead man's snitches or health checks. Have your job ping an external monitoring service (like Cronitor or Sentry) upon successful completion. If the service doesn't receive the ping by 1:45 AM, it triggers an alert for your on-call engineering team.

* Explore

Related expressions you might need

Was this helpful?

Last verified: