Maintenance
Updates
Section titled “Updates”- Security updates: automatic (
unattended-upgrades). - Once a month:
sudo apt update && sudo apt full-upgradefor d in /srv/stacks/*/; do (cd "$d" && docker compose pull && docker compose up -d); donedocker image prune -fsudo reboot- After the reboot: green panel and the round display drawing.
- Armbian kernel or bootloader updates (
linux-*packages): keep the recovery microSD at hand.
Backup
Section titled “Backup”| 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/.
- In the Cloudflare dashboard: enable R2, create the
charmlab-backupbucket and an R2 API token with read and write access to that bucket only. - Copy backup.env.example to
/etc/charmlab/backup.env, fill it in and runsudo chmod 600 /etc/charmlab/backup.env. - Create the repository:
sudo bash -c 'set -a; . /etc/charmlab/backup.env; restic init'- Install the script and the units:
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-reloadsudo systemctl enable --now charmlab-backup.timersudo systemctl start charmlab-backup.service- Check the bucket usage in the R2 dashboard once a month; above 8 GB, reduce retention.
Restore a single path:
sudo bash -c 'set -a; . /etc/charmlab/backup.env; restic restore latest --target /tmp/restore --include /etc/ssh'