configuration

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

linux syntaxlinux
[Timer]OnCalendar=EXPRESSIONOnBootSec=DURATIONPersistent=BOOLUnit=NAME.service[Install]WantedBy=timers.target

Parameters & Attributes

NameTypeDescription
OnCalendardirectiveCalendar schedule
OnBootSecdirectiveMonotonic delay from boot
PersistentdirectiveCatch-up for missed calendar event
UnitdirectiveTarget unit; defaults to corresponding service
WantedBydirectiveEnablement target

Return Value

configuration or inspection

Schedule and activation configuration, not a promise of execution at a precise instant.

Working Example

Example Snippetlinux
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'
Linux Reference