1

Following up on Schedule a job every 20 days,

This is for renewing purpose, thus can be done sooner than 20 days. But I'm doing it from my laptop, which would be put into sleep most of the time. Thus guarantee execution is a must (which I read that cron is lack of).

I chose systemd.timer over crom as I was under the impression that "it would even work when the scheduled time passes by during my system went in sleeping mode, after it wakes up"

However, it turns out to be not the case for me.

Per its man page, the only close option is the Persistent= one:

Takes a boolean argument. If true, the time when the service unit was last triggered is stored on disk. When the timer is activated, the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive. Such triggering is nonetheless subject to the delay imposed by RandomizedDelaySec=. This is useful to catch up on missed runs of the service when the system was powered down. Note that this setting only has an effect on timers configured with OnCalendar=.

However, I just realized that I am using OnUnitActiveSec=20d instead of the required OnCalendar=, so having Persistent=true will not be helping for my Schedule a job every 20 days case, right?

Is it possible for systemd.timer to catch up on missed runs of the services, scheduled with OnUnitActiveSec=, after the computer system has waken up from sleep?

PS. All my systemd packages:

 libpam-systemd:amd64_249.11-0ubuntu3.6
 libsystemd0:amd64_249.11-0ubuntu3.6
 python3-systemd_234-3ubuntu2
 systemd_249.11-0ubuntu3.6
 systemd-sysv_249.11-0ubuntu3.6
 systemd-timesyncd_249.11-0ubuntu3.6
xpt
  • 1,530
  • Related? https://github.com/systemd/systemd/issues/24984 – r2evans Sep 14 '23 at 14:49
  • 1
    Thanks for the link @r2evans, which contains valuable info for troubleshooting. There are "3 days left" for next trigger, and I'll watch closely this time. – xpt Sep 14 '23 at 21:14

0 Answers0