Skip to content

Maintenance

  • Security updates: automatic (unattended-upgrades).
  • Once a month:
Terminal window
sudo apt update && sudo apt full-upgrade
for d in /srv/stacks/*/; do (cd "$d" && docker compose pull && docker compose up -d); done
docker image prune -f
sudo reboot
  • After the reboot: green panel and the round display drawing.
  • Armbian kernel or bootloader updates (linux-* packages): keep the recovery microSD at hand.
Item Value
Tool restic
Destination Cloudflare R2, bucket charmlab-backup, Standard class (free tier: 10 GB per month)
Schedule Every day at 03:30, systemd timer
Included /srv/stacks, /etc, /var/lib/charmlab, /opt/charmlab-status, /home
Before the backup Each stack’s backup-hook (database dumps); package list in /var/lib/charmlab/packages.txt
Retention 7 daily and 4 weekly snapshots
Credentials /etc/charmlab/backup.env (mode 0600) and a password manager
Signal On success the script writes the time to /var/lib/charmlab/last-backup; charmlab-status alerts after 26 hours
Test A full restore once a month

Files: deploy/backup/.

  1. In the Cloudflare dashboard: enable R2, create the charmlab-backup bucket and an R2 API token with read and write access to that bucket only.
  2. Copy backup.env.example to /etc/charmlab/backup.env, fill it in and run sudo chmod 600 /etc/charmlab/backup.env.
  3. Create the repository:
Terminal window
sudo bash -c 'set -a; . /etc/charmlab/backup.env; restic init'
  1. Install the script and the units:
Terminal window
sudo install -m 0755 deploy/backup/charmlab-backup /usr/local/sbin/
sudo install -m 0644 deploy/backup/charmlab-backup.service deploy/backup/charmlab-backup.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now charmlab-backup.timer
sudo systemctl start charmlab-backup.service
  1. Check the bucket usage in the R2 dashboard once a month; above 8 GB, reduce retention.

Restore a single path:

Terminal window
sudo bash -c 'set -a; . /etc/charmlab/backup.env; restic restore latest --target /tmp/restore --include /etc/ssh'