Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article5 min readViews0

systemd-analyze calendar: how to check a timer schedule before enabling it

We normalize OnCalendar, output several future runs with a fixed reference point and time zone, and separately analyze syntax errors and the command's applicability limits.

Comments 0

Three metal time discs with orange markings and a switched-off toggle on a light table
In this article

Before enabling the timer, pass the systemd-analyze calendar command only the value to the right of the OnCalendar= directive, without the directive name or the equals sign. Specify several iterations, a fixed reference point, and an explicit time zone. Accept the schedule only if the normalized form matches the intent, absolute dates are verified, and the command exits with code 0. A non-zero exit code is a reason to stop, not to enable the timer for a trial run.

The check below was performed on November 22, 2026, in an isolated Debian 13 container with systemd 257 (257.13-1~deb13u1). Superuser privileges were not required: we did not create unit files, start services, or alter the state of systemd.

What systemd-analyze calendar specifically demonstrates

The calendar subcommand parses a calendar expression, prints its normalized form, and calculates the next triggers. This is documented in systemd-analyze(1). The syntax is the same as that used in OnCalendar=. You must pass the value to the right of the directive: the full line with the name and equals sign is not parsed. The value itself can be verified before the timer appears in the system.

  • Normalized form must reflect the correct days, time, and time zone.

  • Several lines of Next elapse should yield the expected sequence of absolute dates.

  • The exit code must be 0; a parsing error message blocks further actions.

First, let's check the schedule for weekdays

Assume the backup should start from Monday to Friday at 03:15 Moscow time. We fix the reference point so the result can be reproduced, and ask to show the next three triggers.

systemd-analyze calendar --iterations=3 --base-time='2026-11-22 00:00:00 Europe/Moscow' 'Mon..Fri *-*-* 03:15:00 Europe/Moscow'

Normalized form: Mon..Fri *-*-* 03:15:00 Europe/Moscow

The systemd-analyze utility parsed the expression and returned three consecutive working days. The table preserves absolute values from the output; we do not use the relative row From now as a criterion because it depends on the exact moment the check was run.

Day

Europe/Moscow

UTC

Mon, 23.11.2026

03:15 MSK

00:15 UTC

Tue, 24.11.2026

03:15 MSK

00:15 UTC

Wed, 25.11.2026

03:15 MSK

00:15 UTC

Three verified OnCalendar runs: November 23, 24, and 25 at 03:15 MSK, which corresponds to 00:15 UTC
The next three triggers of the checked expression relative to the reference point of November 22, 2026.

Two checks are important here. Monday indeed follows the Sunday reference point, and Moscow time is correctly converted to UTC. A single successful date would not have revealed an error in the day-of-week range, so we output several events.

Separately check the time zone

Time zone names and the structure of the calendar expression are described in systemd.time(7). If a job must be bound to UTC, it is better to write this directly in the expression rather than relying on the machine's current local time zone.

systemd-analyze calendar --iterations=2 --base-time='2026-11-22 00:00:00 Europe/Moscow' '*-*-* 03:15:00 UTC'

Normalized form: *-*-* 03:15:00 UTC

In this test, the first trigger occurred on November 22 at 03:15 UTC, which is 06:15 MSK; the second trigger occurred on November 23 at the same time. If 03:15 Moscow time was expected, the UTC expression is unsuitable, even though it is syntactically correct.

A parsing error must stop the deployment

Let us test a clearly invalid expression using the same reference point.

systemd-analyze calendar --base-time='2026-11-22 00:00:00 Europe/Moscow' 'not-a-calendar'

Failed to parse calendar specification 'not-a-calendar': Invalid argument

The exit code is 1. Such a result cannot be replaced by visual inspection of the string or hope for a log message after enabling: the expression must be corrected and tested again.

Where does this check end

The command validates the calendar expression but not the behavior of the entire timer. Parameters that may affect the actual trigger are described separately in systemd.timer(5).

  • AccuracySec= sets the allowable precision window, while RandomizedDelaySec= adds a delay.

  • If the parameter Persistent= is set to true, the calendar timer may trigger immediately upon activation if at least one activation was missed during inactivity; such a launch still adheres to RandomizedDelaySec=.

  • calendar does not check unit files, timer enablement, system clock status, task duration, or task success.

  • A matching start time does not prove that the backup completed successfully or is suitable for recovery.

Drawing conclusions from a single indicator is premature: successful parsing of the OnCalendar= value confirms only the schedule, not the entire task execution path.

Timer acceptance order

  1. Extract only the exact value to the right of OnCalendar= from the project; do not transcribe it from memory.

  2. Record the version of systemd, the reference point, and the expected time zone.

  3. Output several future triggers and verify the normalized form, days of the week, local time, and UTC.

  4. If the exit code is non-zero, correct the expression; do not proceed to enable the timer.

  5. Separately verify the structure of the timer and service unit, as well as the influence of AccuracySec=, RandomizedDelaySec=, and Persistent=.

  6. After enabling, in coordination with the system owner, monitor the actual Next and Last, the service log, and the task result.

The schedule is ready for the next stage when the systemd-analyze utility accepts the expression, several absolute dates match the expected days and time zone, and full timer constraints are accounted for separately. Only then does the calendar string cease to be a guess and become a verified input condition.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.