systemd timer unit — Scheduled activation
A .timer activates another unit, normally the same basename with .service. OnCalendar is wall-clock scheduling; OnBootSec is measured from boot; if its deadline has already passed when the timer is activated, it triggers immediately. Multiple expressions can independently trigger a timer. Persistent defaults to false and catches up missed calendar events when enabled, not every historical invocation. AccuracySec commonly defaults to one minute; actual dispatch is not guaranteed to the exact second. An already active target service is not restarted simply because a timer elapses. System timer definitions and drop-ins follow systemd unit precedence. Review target service permissions and runtime before enabling. After approved edits run daemon-reload and reconcile timer activation; inspect list-timers and service logs. Restore prior definitions and activation state on failure. The example validates only the schedule, not the timer runtime.
Formal Syntax & Structure
[Timer]OnCalendar=EXPRESSIONOnBootSec=DURATIONPersistent=BOOLUnit=NAME.service[Install]WantedBy=timers.targetParameters & Attributes
| Name | Type | Description |
|---|---|---|
| OnCalendar | directive | Calendar schedule |
| OnBootSec | directive | Monotonic delay from boot |
| Persistent | directive | Catch-up for missed calendar event |
| Unit | directive | Target unit; defaults to corresponding service |
| WantedBy | directive | Enablement target |
Return Value
Schedule and activation configuration, not a promise of execution at a precise instant.
Working Example
set -eud=$(mktemp -d)trap 'rm -rf -- "$d"' EXITsystemd-analyze calendar --base-time='2026-01-01 00:00:00 UTC' '*-*-* 03:15:00 UTC' > "$d/calendar"grep -F '2026-01-01 03:15:00 UTC' "$d/calendar" >/dev/nullprintf 'next occurrence: 2026-01-01 03:15 UTC\n'