write and validate complex systemd OnCalendar expressions for timer units using systemd-analyze calendar before deploying them
domain: freedesktop.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Write calendar expressions in the DayOfWeek Year-Month-Day Hour:Minute:Second format, using `*` as a wildcard and `/` for step values (e.g., `*-*-* 0/6:00:00` for every 6 hours).
Use comma-separated lists and range syntax for multiple values, e.g., `Mon,Tue *-*-01..04 12:00:00` for Monday and Tuesday in the first four days of any month at noon.
Validate an expression and see its normalized form plus the next trigger time with `systemd-analyze calendar "<expression>"`.
Preview multiple upcoming trigger times (not just the next one) with `systemd-analyze calendar --iterations=5 "<expression>"` to sanity-check a recurring schedule before deploying it.
Check what a shorthand alias actually expands to, e.g. `systemd-analyze calendar weekly`, before relying on `OnCalendar=weekly` in a unit file.
Known gotchas
`systemd-analyze calendar` only parses calendar event expressions, not relative timestamps; passing something like 'tomorrow' errors out even though it reads like valid English.
Omitting the time portion defaults it to 00:00:00, which surprises people expecting the expression to mean 'any time that day.'
A syntactically valid but semantically impossible expression (e.g., Feb 30) is accepted by the parser but will simply never elapse, silently disabling the timer with no runtime error.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?