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
*
How it works

Next 5 Runs

  • in 6m 20s
  • in 21m 20s
  • in 36m 20s
  • in 51m 20s
  • in 1h 6m

* Tools

Code & Implementations

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

# Define lock file to prevent overlapping executions
LOCKFILE="/var/lock/quarter_hourly_job.lock"
exec 9>"$LOCKFILE"

# Attempt to acquire an exclusive lock without blocking
if ! flock -n 9; then
    echo "[$(date '+$Y-%m-%d %H:%M:%S')] Error: Job is already running. Exiting." >&2
    exit 1
fi

echo "[$(date '+$Y-%m-%d %H:%M:%S')] Starting 15-minute maintenance task..."
# Place your production logic here (e.g., database cleanup, log shipping)
# /usr/local/bin/sync-script.sh

echo "[$(date '+$Y-%m-%d %H:%M:%S')] Task completed successfully."
Setup notes

Save this script to /usr/local/bin/my-job.sh, make it executable with 'chmod +x', and register it in your crontab using '*/15 * * * * /usr/local/bin/my-job.sh >> /var/log/my-job.log 2>&1'.

Last verified:

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

Last verified:

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

Last verified:

Was this helpful?