How do the systemctl timer works when the computer is turned off at the given trigger time?
There is the option "Persistent
", but when exactly is the command executed?
In how far is it guaranteed that the command will be safely executed, e.g. that a maximum of given time shall not pass between two executions?
status:
$ systemctl status mintupdate-automation-upgrade.timer
● mintupdate-automation-upgrade.timer - Update Manager automatic upgrades
Loaded: loaded (/lib/systemd/system/mintupdate-automation-upgrade.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Fri 2021-01-22 20:20:24 CET; 4 days ago
Trigger: Thu 2021-01-28 00:44:21 CET; 12h left
Triggers: ● mintupdate-automation-upgrade.service
configuration files
$ systemctl cat mintupdate-automation-upgrade.*
# /lib/systemd/system/mintupdate-automation-upgrade.timer
[Unit]
Description=Update Manager automatic upgrades
[Timer]
OnCalendar=daily
OnStartupSec=60m
RandomizedDelaySec=60m
Persistent=true
[Install]
WantedBy=timers.target
# /lib/systemd/system/mintupdate-automation-upgrade.service
[Unit]
Description=Update Manager automatic upgrades
After=network-online.target
[Service]
Type=oneshot
CPUQuota=50%
CPUWeight=20
IOWeight=20
ExecStart=/usr/lib/linuxmint/mintUpdate/automatic_upgrades.py
[Install]
WantedBy=multi-user.target
The timer has the Persistent flag, but the service (is triggered by timer) has not
$ systemctl show mintupdate-automation-upgrade.timer --property=Persistent
Persistent=yes