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
*

Next 5 Runs

  • in 2m 4s
  • in 5m 4s
  • in 8m 4s
  • in 11m 4s
  • in 14m 4s

* Tools

Code & Implementations

nodejs
const cron = require('node-cron');
const axios = require('axios');

let isTaskRunning = false;

// Schedule task for every 3 minutes: */3 * * * *
cron.schedule('*/3 * * * *', async () => {
  if (isTaskRunning) {
    console.warn('[WARN] Previous task execution is still active. Skipping run to prevent race conditions.');
    return;
  }

  isTaskRunning = true;
  console.log(`[INFO] Executing high-frequency task at ${new Date().toISOString()}`);

  try {
    const response = await axios.get('https://api.example.com/v1/metrics', { timeout: 150000 });
    console.log(`[INFO] Metrics collected successfully. Status: ${response.status}`);
  } catch (error) {
    console.error('[ERROR] Failed to execute 3-minute cron task:', error.message);
  } finally {
    isTaskRunning = false;
  }
});
Setup notes

Install dependencies using 'npm install node-cron axios'. Run this long-running daemon process using PM2 or a systemd service to ensure continuous execution.

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

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

Was this helpful?

Last verified: