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

  1. 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).
  2. 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.
  3. Validate an expression and see its normalized form plus the next trigger time with `systemd-analyze calendar "<expression>"`.
  4. 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.
  5. 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

Related routes

Write a systemd service unit and matching timer unit on Linux to run a script on a schedule
freedesktop.org · 5 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans