Comment 9 for bug 1615482

Revision history for this message
Tony Garcia (tonyskapunk-rax) wrote :

I was able to override it using /etc/systemd/system/apt-daily.timer.d/override.conf with this config:

###

[Timer]
OnCalendar=
OnCalendar=*-*-* 02:00
RandomizedDelaySec=4h
AccuracySec=1m
Persistent=true

###

Which Means:

        OnCalendar | Any day *-*-* at 02:00hrs. NOTE: See the first empty OnCalendar, this was needed otherwise the time defined in here was added from the previous schedule instead of replaced. (https://github.com/systemd/systemd/issues/3233)
RandomizedDelaySec | Add a random delay of up to 4:00hrs [02:00-06:00]
       AccuracySec | Start the process at any time within 1m of the calculated time (oncalendar + randomizeddleaysec) this results in [02:00-06:01]

---

Default is:

###

[Timer]
OnCalendar=*-*-* 6,18:00
RandomizedDelaySec=12h
AccuracySec=1h

###

Which means:
        OnCalendar | Any day *-*-* at 06:00hrs and 18:00hrs
RandomizedDelaySec | Add a random delay of up to 12:00hrs [06:00-18:00, 18:00-06:00] (NOTE: at this point it could be any time!)
       AccuracySec | Start the process at any time within 1h of the calculated time (oncalendar + randomizeddleaysec) this results in [06:00-19:00, 18:00-07:00]

---

Here I tested the overridden configuration:

# systemctl list-timers | grep -P "NEXT|apt"
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2017-04-21 05:46:11 CDT 17h left Thu 2017-04-20 11:42:55 CDT 3min 29s ago apt-daily.timer apt-daily.service
# systemctl restart apt-daily.timer && systemctl list-timers | grep -P "NEXT|apt"
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2017-04-21 02:58:14 CDT 15h left Thu 2017-04-20 11:42:55 CDT 3min 44s ago apt-daily.timer apt-daily.service
# systemctl restart apt-daily.timer && systemctl list-timers | grep -P "NEXT|apt"
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2017-04-21 04:05:12 CDT 16h left Thu 2017-04-20 11:42:55 CDT 3min 53s ago apt-daily.timer apt-daily.service
# systemctl restart apt-daily.timer && systemctl list-timers | grep -P "NEXT|apt"
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2017-04-21 05:44:41 CDT 17h left Thu 2017-04-20 11:42:55 CDT 4min 0s ago apt-daily.timer apt-daily.service
# systemctl restart apt-daily.timer && systemctl list-timers | grep -P "NEXT|apt"
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2017-04-21 03:05:18 CDT 15h left Thu 2017-04-20 11:42:55 CDT 4min 1s ago apt-daily.timer apt-daily.service
# systemctl restart apt-daily.timer && systemctl list-timers | grep -P "NEXT|apt"
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2017-04-21 03:48:18 CDT 16h left Thu 2017-04-20 11:42:55 CDT 4min 4s ago apt-daily.timer apt-daily.service