diff --git a/borgbackup.nix b/borgbackup.nix index a4f7312..8f7f15b 100644 --- a/borgbackup.nix +++ b/borgbackup.nix @@ -48,8 +48,8 @@ prune.keep = { within = "1d"; daily = 7; - weekly = 4; - monthly = 6; + weekly = 2; + monthly = 3; }; }; } diff --git a/void.nix b/void.nix index 6d578d0..7c266f8 100644 --- a/void.nix +++ b/void.nix @@ -105,6 +105,45 @@ Requires = "external.mount"; }; }; + services.borgbackup.jobs."hetzner" = { + paths = [ + "/home" + "/var" + "/pile" + ]; + exclude = [ + "/home/*/.local/share/Steam" + "**/*cache" + "**/*Cache" + "**/*trash" + "**/*Trash" + "/home/*/.mozilla/firefox" + "/home/*/GOG Games" + "**/target" + "**/result" + "/var/log" + ]; + repo = "ssh://u480566-sub1@u480566-sub1.your-storagebox.de:23/./repo"; + encryption = { + mode = "repokey-blake2"; + passCommand = "cat /root/borgbackup/hetzner_passphrase"; + }; + environment.BORG_RSH = "ssh -i /root/borgbackup/hetzner_ssh_key"; + compression = "auto,lzma"; + startAt = "daily"; + persistentTimer = true; + extraCreateArgs = ["--stats" "--info" "--list" "--filter" "AMEC"]; + extraPruneArgs = ["--stats" "--info" "--list"]; + prune.keep = { + within = "1d"; + daily = 7; + weekly = 4; + monthly = 12; + }; + preHook = '' + /bin/sh -c 'while ! /run/current-system/sw/bin/ping -c1 google.com; do sleep 1; done' + ''; + }; # postgresql backup services.postgresqlBackup = {