Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 1.55 KB

automated-tasks.md

File metadata and controls

77 lines (52 loc) · 1.55 KB

JSDD > Setup and secure a VPS > Automated tasks

Automated tasks

Automatic updates

source

Install auto-upgrader

apt-get install unattended-upgrades

Configure the updates you want

vi /etc/apt/apt.conf.d/10periodic

With content :

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

And this file

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

Keep updates disabled and stick with security updates only

Unattended-Upgrade::Allowed-Origins {
        "${distro_id}:${distro_codename}-security";
//      "${distro_id}:${distro_codename}-updates";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};

Send an e-mail alert when applying an update to ensure that everything worked properly.

Uncomment this line and provide your admin e-mail

Unattended-Upgrade::Mail "[email protected]";

log management

Install and configure logwatch

apt-get install logwatch
vi /etc/cron.daily/00logwatch

Replace this line

/usr/sbin/logwatch --output mail

with this one (provide your admin e-mail)

/usr/sbin/logwatch --output mail --mailto [email protected] --detail high

Finally, adjust the log rotation in /etc/logrotate.d/* according to log files' volume on production server.