Run Every Three Minutes Schedule Guide | CronBase

cron expression Standard
$ */3 * * * *

Every three minutes

The `*/3 * * * *` cron expression executes a task automatically every three minutes of every hour, every day of the week, and every month of the year. This rapid interval is typically used for continuous monitoring, high-frequency data ingestion, log rotation checks, and health probes in distributed microservices.

Minute
*/3
Hour
*
Day of Month
*
Month
*
Day of Week
*
How it works

Next 5 Runs

  • in 37s
  • in 3m 37s
  • in 6m 37s
  • in 9m 37s
  • in 12m 37s

* Tools

Code & Implementations

Bash
#!/usr/bin/env bash
# Production Bash script for a 3-minute cron task with locking mechanism
set -euo pipefail

LOCKFILE="/var/lock/my_three_minute_task.lock"
TIMEOUT_SECS=170 # Slightly less than 3 minutes to prevent overlap

# Ensure single instance execution using flock
exec 9>"$LOCKFILE"
if ! flock -n 9; then
    echo "[ERROR] Another instance of the task is still running. Exiting to prevent overlap." >&2
    exit 1
fi

echo "[INFO] Starting 3-minute cron execution at $(date -u)"
# Simulate production workload with timeout protection
timeout "$TIMEOUT_SECS" curl -sSf https://api.internal/health-check || {
    echo "[ERROR] Task failed or timed out" >&2
    exit 1
}
echo "[INFO] Task completed successfully"
Setup notes

Save the script to /usr/local/bin/three_min_job.sh, make it executable using chmod +x, and configure it inside your crontab using: */3 * * * * /usr/local/bin/three_min_job.sh >> /var/log/three_min_job.log 2>&1

Last verified:

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

Systemd Timer

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

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

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

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

What happens if a task takes longer than 3 minutes to run?

If a task exceeds the 3-minute window, a new execution will start concurrently unless concurrency controls are set. This can lead to race conditions, CPU spikes, and database connection pool exhaustion. Implement distributed locks or concurrency policies like Kubernetes 'Forbid' to prevent this.

How can I prevent overlapping runs on this fast schedule?

Prevent overlapping by using flock in Bash scripts, setting concurrencyPolicy: Forbid in Kubernetes CronJobs, or utilizing memory/mutex locks in application code. For distributed setups, implement a lock using Redis or a database table to ensure only one instance executes at a time.

Is this high-frequency schedule safe for database transactions?

Generally, no. Running database-heavy operations every 3 minutes can lead to lock contention, transaction timeouts, and high CPU utilization. If database writes are necessary, keep them highly optimized, use indexed fields, batch the transactions, and ensure connections are released immediately.

How does timezone configuration affect this 3-minute cron?

Because the job runs continuously every 3 minutes, local timezone shifts (like Daylight Saving Time) do not affect the frequency of execution; it will still execute every 3 minutes. However, your logging and audit timestamps may shift, so setting the system timezone to UTC is highly recommended.

Can I use standard cron for sub-minute executions?

No, standard cron dialects only support a minimum resolution of one minute. If you require sub-minute execution (e.g., every 30 seconds), you must use a daemonized loop, a specialized task scheduler like Celery, or a continuous service runner rather than cron.

* Explore

Related expressions you might need

Last verified:

Was this helpful?