I have setup automatic updates and it updates automatically. However, there are updates that require a restart and I know
Unattended-Upgrade::Automatic-Reboot "true";
will set it to reboot. But it reboots as soon as it updates. That could be at any time of the day, when my users are using my server. I want it to restart at a specific time, say 12:00 am that night. How do I do that?
Have a look in /etc/apt/apt.conf.d/50unattended-upgrades. You want
Unattended-Upgrade::Automatic-Reboot-Time
:You can disable automatic reboot by setting in your configuration file :
Reconfigure it :
Write a script to check whether a reboot is required :
Set the correct permissions on the script :
Set a cron job so it will be executed everyday at 12 am.
Then append the above :
Save it and it's done.