我想apt-get更新来指挥一个脚本来引导它重新启动一个系统。 如果有更新重新启动,我希望系统运行apt-get更新。 这是为了保持一个简单的系统更新。 答案可能有点复杂,我似乎无法开始解决这个问题。
系统运行Debian Wheezy。 这是在一个用户运行脚本和rsync的默认情况下。 没有什么花哨。
使用apt的无人值守升级包。 如有必要,可以select重新启动:
// Automatically reboot *WITHOUT CONFIRMATION* // if the file /var/run/reboot-required is found after the upgrade Unattended-Upgrade::Automatic-Reboot "true"; // If automatic reboot is enabled and needed, reboot at the specific // time instead of immediately // Default: "now" Unattended-Upgrade::Automatic-Reboot-Time "02:00";
对于一个很好的写法,请参阅: http : //linux-audit.com/using-unattended-upgrades-on-debian-and-ubuntu/