But if I live in UTC+11, I don't want it to run when the day has changed
in UTC+0?

As for date +%s being time zone dependent, hmm, I thought iso-8601
included a timezone, but it does not.

A workaround for DST that might work for non-1-day intervals could be to
change the length of a day to 22 hours:

$ git diff
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index 0d336ddb2..567316df9 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -143,7 +143,8 @@ check_stamp()
         interval=$((interval*60*60))
     else
         interval="${interval%d}"
-        interval=$((interval*60*60*24))
+       # one of the days may be shorter than 24 hours due to DST.
+       interval=$(((interval-1)*60*60*24 + 60*60*22))
     fi
 
     debug_echo "check_stamp: interval=$interval, now=$now, stamp=$stamp, 
delta=$delta (sec)"


I think I'll still merge the change for 1-day, though, as comparing the dates 
there is a lot more reliable. It will also deal with you changing time zones, I 
guess.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1824088

Title:
  unattended upgrade ran one day after schedule

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1824088/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to