Imagine a recurring reconciliation task scheduled every fifteen minutes. During ordinary weeks it finishes in ninety seconds. On the last day of the month, input volume triples and a slow upstream table stretches one run to twenty-two minutes. At minute fifteen, a second instance starts, reads the same uncommitted window, contends for the same rows, and doubles the load on the database that was already falling behind.

This is a hypothetical billing job, not a postmortem from a live service. A schedule expression says when a trigger may fire; it says nothing about concurrency, backlog, or recovery after a host restart. Those rules belong to the job’s execution contract.

Choose one overlap policy

Every periodic job eventually meets a slow dependency or an unusually large batch. Instead of letting the scheduler’s default behavior decide by accident, pick one explicit rule for an arriving trigger while an earlier run is still active.

Skip
Drop the new trigger when an active run already covers new arrivals or will be followed soon by another regular tick.
Queue one
Record at most one pending follow-up run so work arriving after the current snapshot is picked up without unbounded pile-up.
Replace
Cancel the older run only when partial work is read-only or safely rolled back and only the freshest snapshot matters.
Partition
Allow parallel runs only when each worker claims a disjoint shard or lease key in storage.

For most maintenance and aggregation tasks, skipping or coalescing into a single follow-up run is safer than stacking processes. Stacking turns a temporary slowdown into resource exhaustion: memory rises, lock waits multiply, and every overlapping copy makes all of the others slower.

A cron expression defines a clock, not a concurrency limit. Without an overlap rule, the slowest dependency sets the degree of parallelism.

Bind exclusion to a process or lease lifetime

Once the policy is chosen, enforce it with a primitive that cleans up after an abrupt exit. A plain lock file containing a process ID fails in both directions: if the process crashes before unlinking the file, future runs stay blocked; if the operating system recycles the numeric PID, a stale file appears to belong to an unrelated live process.

On a single host, two mechanisms avoid stale-file guesswork. First, systemd timer units paired with a oneshot service serialize triggers for the same unit by default: while the service unit is active, another timer elapse does not launch a duplicate process. Second, Linux’s flock(2) associates an advisory lock with an open file description in the kernel, releasing it automatically if the process exits or is killed.

Across multiple hosts, local kernel state is no longer enough. Use a storage-backed lease with a monotonic fencing token and an explicit time-to-live, renewed only while the worker is making progress, and paired with a hard execution timeout so a wedged process stops writing before another holder takes over. The lease lifecycle note covers the same fail-closed principle for time-bounded authority.

Bound catch-up after downtime

A scheduler also has to decide what happens when the host was powered off or the timer was paused across several intervals. Firing twenty missed runs back-to-back rarely reconstructs twenty neat historical snapshots; more often it hammers an API or repeats identical work twenty times at startup.

Read what the scheduler actually promises. In systemd, enabling Persistent=true records the last trigger timestamp on disk and triggers the service once immediately when the timer becomes active after a missed elapse, rather than replaying every missed tick. Add RandomizedDelaySec= when several independent timers share the same minute boundary so they do not wake storage and network links in lockstep.

Where the business logic genuinely processes discrete time windows—such as hourly rollups—separate the trigger from the window cursor. Have one single run iterate forward from the last completed window in bounded batches, pausing or yielding if the backlog exceeds a safe recovery budget. The queue age-limit note explains how to size that recovery budget so old work cannot starve current traffic.

Advance by durable checkpoints, not wall-clock guesses

A job that queries “everything created in the last fifteen minutes” using the current wall clock will silently miss records whenever a run starts late or skips an interval, and will double-count records whenever a run starts early. Wall-clock windows couple data correctness to scheduler jitter.

Store an explicit high-water mark—a sequence number, committed transaction age, or window boundary—in the same durable store as the output, or make each item’s side effect idempotent under a deterministic key. When a run fails halfway through, the next run should resume from the last committed checkpoint without human repair. As the timeout note observes, retries are safe only when partial progress can be inspected rather than assumed away.

Distinguish “nothing to do” from “did not run”

Interactive services fail loudly because callers notice errors immediately. Background jobs fail quietly: a disabled timer, an expired credential, or a silently skipped lock can produce days of calm logs while obligations accumulate.

Record two separate signals at the end of every run: completion timestamp and outcome summary (items scanned, items updated, skipped-overlap count, and duration). Monitor the age of the last successful completion against the job’s maximum tolerated staleness, not merely whether the last exit code was zero. A run that finds zero eligible items should still advance the last-checked timestamp so an actionable alert can tell an idle Tuesday apart from a dead scheduler.

Keep a recurring-job contract

Before enabling a new timer or cron entry, write six lines alongside its unit or manifest:

  • Cadence and jitter: target interval, allowed random delay, and time zone if calendar-bound.
  • Overlap rule: whether a busy run skips, coalesces one follow-up, or partitions by lease key.
  • Maximum runtime: hard timeout and cleanup behavior when a dependency stalls.
  • Downtime catch-up: whether missed intervals coalesce into one run or advance a stored window cursor.
  • Checkpoint and idempotency: where progress is stored and why re-running a partial batch is safe.
  • Staleness signal: the metric or timestamp proving a healthy run completed within its expected window.

When those six answers are explicit, a slow afternoon degrades into one delayed batch rather than a thundering herd of competing workers.