Expand description
When is this trigger next due?
Interval, cron and one-shot are three declarations of one primitive: a function from “when did it last fire” to “when should it fire next”. They are kept apart in the vocabulary because they read differently to a person, not because the evaluator treats them differently.
Two behaviours here are worth stating because they are the ones people get wrong:
Rate drifts; cron does not. interval_secs anchors to the last firing,
so a 3-minute job on a 5-minute interval leaves a 2-minute gap and the
effective period depends on runtime. */5 * * * * anchors to wall-clock
boundaries and does not. Both are correct; users need to know which they
chose, so the two are separate kinds rather than one field with a flag.
Catch-up collapses by default. A laptop closed over a weekend has missed
hundreds of occurrences. Catchup::Last fires once on resume, which is what
anacron does and what systemd’s Persistent=true means. All replays them
and None drops them; the three-way is Quartz’s misfire vocabulary — fire
once now / skip / replay all.
Functions§
- advance_
after_ firing - Where to set
next_due_atafter a firing that happened atfired_at_ms, given that it is nownow_ms. - backoff_
until - Back off
next_due_atafter a failure, so a broken connector does not hot-loop against a source that is down. - exhausts_
after - Whether this trigger can never fire again after a firing at
fired_at_ms. - initial_
due - When a never-evaluated trigger first becomes due.
- is_due
- Is this trigger due at
now_ms? - next_
due_ after - The next instant at or after
after_msat whichtriggershould fire. - validate
- Parse and validate a declaration’s schedule without evaluating it.