Run Jobs Every 15 Minutes Safely | CronBase

cron expression Standard
$ */15 * * * *

Every fifteen minutes, at the start of each quarter-hour interval.

This cron expression schedules a task to execute every fifteen minutes, specifically at the zero, fifteenth, thirtieth, and forty-fifth minute of every hour. It is commonly used for high-frequency operations like processing message queues, checking system health, pulling API updates, or synchronizing lightweight cache databases.

Minute
*/15
Hour
*
Day of Month
*
Month
*
Day of Week
*

Next 5 Runs

  • in 1m 40s
  • in 16m 40s
  • in 31m 40s
  • in 46m 40s
  • in 1h 1m

* Tools

Code & Implementations

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

let isJobRunning = false;

// Schedule task to run every 15 minutes
cron.schedule('*/15 * * * *', async () => {
    if (isJobRunning) {
        logger.warn('Previous execution is still running. Skipping this cycle to prevent overlaps.');
        return;
    }

    isJobRunning = true;
    logger.info('Starting 15-minute synchronization task...');
    const startTime = Date.now();

    try {
        // Place async business logic here
        await performSynchronization();
        logger.info({ durationMs: Date.now() - startTime }, 'Task completed successfully.');
    } catch (error) {
        logger.error({ err: error }, 'Task execution failed.');
    } finally {
        isJobRunning = false;
    }
});

async function performSynchronization() {
    return new Promise(resolve => setTimeout(resolve, 5000));
}
Setup notes

Install 'node-cron' and your logging library ('pino' in this example). Run the script using a process manager like PM2 to ensure high availability and automatic restarts.

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(*/15 * * * ? *)

Systemd Timer

OnCalendar*-*-* *:00/15:00

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

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

[Install]
WantedBy=timers.target

Frequently Asked Questions

How do I prevent overlapping executions if a task takes longer than 15 minutes?

To prevent overlapping executions, implement a locking mechanism. In single-server environments, use utility wrappers like 'flock' in Bash or atomic flags in application code. In distributed or clustered environments, use a distributed locking library such as Redlock with Redis, or database-backed locks to guarantee mutually exclusive execution.

Does daylight saving time (DST) affect a 15-minute cron schedule?

Because standard cron runs relative to the system's local time, DST transitions can cause duplicate runs or missed runs if the clock steps backward or forward. To maintain strict, uninterrupted fifteen-minute intervals, configure your servers and cron engines to run in UTC (Coordinated Universal Time) which does not observe DST.

How can I add jitter to prevent multiple servers hitting a database at the exact same minute?

To prevent a thundering herd, introduce a randomized sleep delay at the very beginning of your task execution. For example, in Bash, use 'sleep $((RANDOM % 30))' to offset the execution start time dynamically by up to 30 seconds across different servers without changing the core cron schedule.

What is the best way to monitor and alert on failures for this high-frequency job?

Set up a dead man's switch monitoring tool (such as Healthchecks.io or Opsgenie Heartbeats). Configure it to expect an HTTP ping from your job every 15 minutes. If the ping is not received within a 5-minute grace period, trigger an immediate high-priority alert to notify your on-call engineering team.

Can I use standard cron to run a job every 15 minutes but only during business hours?

Yes, you can restrict the hour field in standard cron. For example, using '*/15 9-17 * * 1-5' will run the task every 15 minutes, but only between the hours of 9:00 AM and 5:59 PM, Monday through Friday, aligning the execution perfectly with standard office business hours.

* Explore

Related expressions you might need

Was this helpful?

Last verified: