infra/docs/backups.md
teutat3s 09804f5c25
All checks were successful
Flake checks / Check (pull_request) Successful in 3m43s
docs: how-to add backups for new hosts
2024-08-29 16:36:11 +02:00

1.2 KiB

Backups

We use Restic to create backups and push them to two repositories. Check ./modules/backups.nix and ./hosts/nachtigall/backups.nix for working examples.

Hetzner Storagebox

  • Uses SFTP for transfer of backups

Adding a new host SSH public key to the storagebox:

First, SSH to nachtigall, then become root and add the new SSH public key

sudo -i
echo '<ssh-public-key>' | ssh -p23 u377325@u377325.your-storagebox.de install-ssh-key

Link to Hetzner storagebox docs.

Garage S3 buckets

  • Uses S3 for transfer of backups
  • One bucket per host, e.g. nachtigall-backups, metronom-backups

To start transfering backups from a new hosts, this is how to create a new bucket:

First, SSH to trinkgenossin, then use the garage CLI to create a new key and bucket:

export GARAGE_RPC_SECRET=<secret-in-keepass>

garage bucket create <hostname>-backups
garage key create <hostname>-backups-key
garage bucket allow <hostname>-backups --read --write --key <hostname>-backups-key