debian - running unattended-upgrades on a particular day of the week

Posted by dastra on Server Fault See other posts from Server Fault or by dastra
Published on 2012-12-03T11:19:00Z Indexed on 2013/10/22 9:59 UTC
Read the original article Hit count: 326

We're running unattended-upgrades on debian squeeze, and would like it to run once a week, only on a Wednesday morning.

To attempt this, we have set:

APT::Periodic::Unattended-Upgrade "7"

in /etc/apt/apt.conf.d/50unattended-upgrades

And then touched the /var/lib/apt/periodic/update-stamp to set the timestamp to a Wednesday, for instance:

touch -t 201211280000 /var/lib/apt/periodic/update-stamp

Running:

stamp=$(date --date=$(date -r /var/lib/apt/periodic/update-stamp --iso-8601) +%s 2>/dev/null)

date -u --date="1970-01-01 $stamp sec GMT"

Gives the correct timestamp:

Wed Nov 28 00:00:00 UTC 2012

However, unattended-upgrades then seems to ignore this, and run the updates on a Saturday morning.

Could anyone enlighten me as to how this parameter works, and how to set up upgrades to run on a Wednesday?

© Server Fault or respective owner

Related posts about debian-squeeze

Related posts about unattended