Skip to content

Backup

This page documents how VPS'es are backed-up, and where.

The backup strategy relies on the following components:

How-to setup backup on a fresh VM

Let's assume cloud-init has ran correctly, so:

  • there's a unique password for restic in /etc/restic.passwd
  • root has a password-less ed25519 SSH key, which public part is in /root/.ssh/id_ed25519.pub

You still need to:

  1. Add the root key to the rsync.net account

1.1. Get the key from the host

sudo cat /root/.ssh/id_ed25519.pub

1.2. From a host from which you have a valid key to access the rsync.net account:

echo "$SSH_PUBKEY" | ssh zh1498@zh1498.rsync.net 'dd of=.ssh/authorized_keys oflag=append conv=notrunc'
  1. Update /etc/backup.d/90-rsync-net.restic to make sure the right directories are included / excluded
  2. Store the RESTIC_PASSWORD as found in /etc/restic.passwd to Bitwarden, in the Flosstools collection.
  3. Run the backup once
sudo backupninja --conffile /etc/backup.d/90-rsync-net.restic --debug --now

It will now run every night at 1h, unless otherwise configured