From ac1e8d2f3ff5a6f5c818d3f9f7a797d42ae93406 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Thu, 3 Jul 2025 23:41:18 +0200 Subject: [PATCH] challenger/backup: Add remote cloud backups --- hosts/challenger/backup.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hosts/challenger/backup.nix b/hosts/challenger/backup.nix index 5690f7d..ce532ea 100644 --- a/hosts/challenger/backup.nix +++ b/hosts/challenger/backup.nix @@ -13,6 +13,18 @@ "--keep-yearly 10" ]; }; + cloudJob = name: paths: { + inherit paths; + # "rsyncnet" connection details specified in /root/.ssh/config + repository = "sftp://rsyncnet/restic/challenger/${name}"; + passwordFile = config.sops.secrets."restic/${name}".path; + initialize = true; + pruneOpts = [ + # rsync.net keeps daily snapshots + "--keep-weekly 4" + "--keep-monthly 36" + ]; + }; in { postgres = (localJob "postgres" [ "/var/backup/postgres" ]) // { timerConfig.OnCalendar = "05:15"; # 2h after postgresqlBackup @@ -32,6 +44,7 @@ # Nextcloud data nextcloud = localJob "nextcloud" [ "/tank/nextcloud" ]; + nextcloud-remote = cloudJob "nextcloud" [ "/tank/nextcloud" ]; # TODO: timemachine, komga };