Hacker News new | ask | show | jobs
by ehou 1727 days ago
Not OP. My servers get this:

    $ apt install unattended-upgrades

    # /etc/apt/apt.conf.d/99unattended-upgrades-custom
    Unattended-Upgrade::Sender "Root at servername.domain.tld <servername.domain.tld@servicesdomain.tld>";
    Unattended-Upgrade::Mail "services@servicesdomain.tld";
    Unattended-Upgrade::MailReport "on-change";
    Unattended-Upgrade::Automatic-Reboot "true";
    Unattended-Upgrade::Automatic-Reboot-Time "05:00";
    
    $ sudo systemctl edit apt-daily.timer
    # Opens a new file /etc/systemd/system/apt-daily.timer.d/override.conf, paste this content:
    
    [Timer]
    # Reset the system calendar config first
    OnCalendar=
    # Set a new calendar timer with a 60 minute threshold
    OnCalendar=*-*-* 03:00
    RandomizedDelaySec=30m
    
    $ sudo systemctl edit apt-daily-upgrade.timer
    # Opens a new file /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf, paste this content:
    
    [Timer]
    # Reset the system calendar config first
    OnCalendar=
    # Set a new calendar timer with a 60 minute threshold
    OnCalendar=*-*-* 04:00
    RandomizedDelaySec=30m
.. and are auto-updated. When a reboot is needed after an update, it gets rebooted automatically.