Field-by-Field Breakdown of `*/2 * * * *`
| Position | Field Name | Allowed Values | Value in `*/2 * * * *` | Evaluation Meaning |
|---|---|---|---|---|
| 1 | Minute | 0 – 59 | */2 | */2 (Even minutes: 0, 2, 4, 6... 58) |
| 2 | Hour | 0 – 23 | * | * (Every hour: 0-23) |
| 3 | Day of Month | 1 – 31 | * | * (Every day of the month: 1-31) |
| 4 | Month | 1 – 12 | * | * (Every month: 1-12) |
| 5 | Day of Week | 0 – 6 (Sun-Sat) | * | * (Every day of the week: 0-6) |
High-Frequency Step Cadence and Worker Load
Running tasks every 2 minutes provides near-real-time automation without the heavy system daemon churn of a 1-minute loop. It is widely used for processing queued jobs, syncing webhook events, and streaming heartbeat telemetry.
Because */2 fires at every even minute, the maximum latency between task runs is 120 seconds. If an invocation encounters an intermittent network timeout, the next run begins in moments.
Scripts scheduled every 2 minutes must be strictly bound by execution limits. An unhandled loop that hangs for 3 minutes will spawn overlapping instances unless wrapped with lockfiles.
Common Production Scenarios for `*/2 * * * *`
Webhook Event Ingestion Buffer
Drains incoming Stripe and GitHub webhook event payloads from temporary Redis streams to persistent database tables.
/usr/bin/node /opt/webhooks/process_incoming_queue.jsPayment Settlement Status Polling
Polls async bank transfer statuses for pending user deposits requiring immediate account balance updates.
/usr/bin/python3 /opt/billing/poll_pending_payments.pyDistributed Cache Node Liveness Check
Pings secondary Redis/Memcached cluster nodes, triggering automated failover alerts if heartbeats fail twice consecutively.
/usr/local/bin/check_redis_nodes.shProduction Gotchas When Running `*/2 * * * *`
- Job Accumulation: A 120-second window leaves little buffer for slow database queries. Wrap all jobs in flock -n to prevent pileups.
- Database Connection Churn: Opening and closing hundreds of database connections every 2 minutes can exhaust connection pools. Use connection pooling (PgBouncer).
- Local Mail Bloat: Ensure output is piped to logfiles or /dev/null to avoid 720 automated emails daily.
Frequently Asked Questions About `*/2 * * * *`
Does */2 * * * * run on odd minutes?
No, */2 starts from minute 0 and evaluates even minutes only: 0, 2, 4, 6, 8, 10, 12, etc.
How do I run a job on odd minutes instead of even minutes?
Use a range with a step: 1-59/2 * * * * /path/to/script.sh. This triggers at minutes 1, 3, 5, 7, 9... 59.
What happens if a 2-minute job takes 90 seconds to finish?
It finishes safely 30 seconds before the next run begins. However, if execution time fluctuates above 120 seconds, concurrent processes will overlap without lock protection.