Run Tasks Every 15 Minutes During Day | CronBase

cron expression Standard
$ */15 8-20 * * *

Every fifteen minutes starting in the morning and continuing through mid-evening every day.

This cron expression executes a task every fifteen minutes during the thirteen hour block starting at eight AM and ending at eight forty five PM daily. It is designed to run jobs frequently during peak operational daytime and evening hours, while automatically pausing execution overnight to conserve system resources.

Minute
*/15
Hour
8-20
Day of Month
*
Month
*
Day of Week
*

Next 5 Runs

  • in 14m 49s
  • in 29m 49s
  • in 44m 49s
  • in 59m 49s
  • in 1h 14m

* Tools

Code & Implementations

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

logger.info('Initializing Node.js daytime cron scheduler...');

// Schedule: Every 15 minutes, between 08:00 and 20:59 daily
const task = cron.schedule('*/15 8-20 * * *', () => {
  logger.info('Starting scheduled daytime synchronization task...');
  
  const start = Date.now();
  exec('/usr/local/bin/sync-script.sh', (error, stdout, stderr) => {
    const duration = Date.now() - start;
    if (error) {
      logger.error({ err: error, duration, stderr }, 'Task execution failed');
      return;
    }
    logger.info({ duration, stdout }, 'Task completed successfully');
  });
});

// Handle graceful shutdown
process.on('SIGTERM', () => {
  logger.info('SIGTERM received. Stopping cron scheduler...');
  task.stop();
  process.exit(0);
});
Setup notes

Install dependencies using npm install node-cron pino and run this script as a long-running background daemon process managed by 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(*/15 8-20 * * ? *)

Systemd Timer

OnCalendar*-*-* 08..20:00/15:00

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

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

[Install]
WantedBy=timers.target

Frequently Asked Questions

Does this expression execute at nine PM?

No. The hour range is eight to twenty inclusive. The last execution of the block occurs at eight forty-five PM (20:45), and the scheduler remains idle until eight AM (08:00) the following morning.

How do daylight saving time transitions affect this daytime schedule?

If your system clock operates on local time, the spring transition will skip one hour of executions, while the autumn transition will repeat an hour of executions. To avoid duplicate or missed runs, configure your cron daemon or scheduler to run on UTC.

What happens if a job takes longer than fifteen minutes to complete?

If an execution exceeds fifteen minutes, a new instance will spawn while the previous one is still running, potentially causing database locks or resource exhaustion. Implement file locking, mutexes, or set concurrency policies to prevent overlapping executions.

Can I restrict this fifteen-minute schedule to weekdays only?

Yes, you can append a weekday restriction by changing the final field. Modifying the expression to `*/15 8-20 * * 1-5` will restrict executions to Monday through Friday, keeping weekends completely free of executions.

How does this schedule help optimize cloud infrastructure costs?

By turning off executions between nine PM and eight AM, you eliminate eleven hours of compute time daily. This is highly effective for serverless functions, database scaling, and API gateways that charge per invocation.

* Explore

Related expressions you might need

Was this helpful?

Last verified: