09 Auto-updates and Cloud Backups

Table of Contents

Previous Page

Next Page


NEEDRESTART

needrestart is a neat little tool that automatically reloads running packages when an update so requires.
Essentially, an update or change doesn’t take effect until a reload.
In the case of needrestart, this can be installed/enabled on all devices.

  1. install package
sudo apt install needrestart
  1. open config file for settings
sudo nano /etc/needrestart/needrestart.conf
  1. Delete ”#” to enable, and change “i” to “a” in this line to make automatic:
    $nrconf{restart} = ‘a’;

UNATTENDED-UPGRADES

This is really the ‘auto-update’ feature, that I enable on 24/7 servers.
If it’s not always running, I just run updates myself when I think about it.
The default settings work, and they only auto-install security updates.

  1. Install package
sudo apt install unattended-upgrades
  1. Run simple config command
sudo dpkg-reconfigure -plow unattended-upgrades
  1. Restart & check status
sudo systemctl restart unattended-upgrades.service &&
sudo systemctl status unattended-upgrades.service
  1. Optional check that both values are “1”
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
  1. Option to change some values to “enable” for “remove unused” things in 3 places:
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
  1. Logs if you want to see what be happening.
sudo nano /var/log/unattended-upgrades/unattended-upgrades.log
sudo nano /var/log/unattended-upgrades/unattended-upgrades-dpkg.log

RCLONE CLOUD BACKUP

rclone is another neat tool, that syncs to existing cloud services without their annoying app!
Meaning you can sync/upload to google drive, onedrive, etc, on your own terms.
I now have Proton Drive, so that’s my cloud of choice.

  1. Install rclone, with bash to weblink
sudo -v ; curl https://rclone.org/install.sh | sudo bash
  1. update rclone (this will need done manually, will not update with “sudo apt update”)
rclone selfupdate
  1. run config! (follow on screen directions, website can help too)
    rclone website
rclone config
  1. After running config, which sets names, can turn command into a script:
sudo nano /usr/local/bin/rcbono
#!/bin/sh

SRC=/home/daddio/zBonoBacks
DEST=proton:zBonoProton

rclone --retries 2 \
       --fast-list \
       --skip-links \
       --size-only \
       --checkers 6 \
       --transfers 6 \
       --drive-chunk-size 256M \
       --exclude '.*{/**,}' \
       -P \
       sync ${SRC} ${DEST}
sudo chmod +x /usr/local/bin/rcbono

Table of Contents

Previous Page

Next Page