问题原文
原帖链接 · Abdulsattar Mohammed · CC BY-SA 4.0
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?
已采纳解答
原帖链接 · Andrew Schulman · CC BY-SA 4.0
Have a look in /etc/apt/apt.conf.d/50unattended-upgrades. You want Unattended-Upgrade::Automatic-Reboot-Time:
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
It takes the time provided and uses it on /sbin/shutdown -r (source). This means you can use any time that shutdown accepts, in your set timezone.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
