From e3d1d34f5be047cd7b06ff7528e83ff14d0f3724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 15 Jan 2023 20:03:31 +0200 Subject: [PATCH] fine-tune backup repo --- configuration.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 6d24cbf..e193f66 100644 --- a/configuration.nix +++ b/configuration.nix @@ -118,14 +118,17 @@ let ssh_pubkeys = { restic.backups = { var_lib = { paths = ["/var/lib/.snapshot-latest/gitea" "/var/lib/.snapshot-latest/headscale"]; - repository = "sftp:zh2769@zh2769.rsync.net:hel1-a.servers.jakst/var_lib"; + repository = "sftp:zh2769@zh2769.rsync.net:hel1-a.servers.jakst"; initialize = true; passwordFile = "/var/src/secrets/restic/password"; backupPrepareCommand = '' + set -euo pipefail + ${pkgs.util-linux}/bin/umount /var/lib/.snapshot-latest || : mkdir -p /var/lib/.snapshot-latest ${pkgs.util-linux}/bin/mount -t zfs $(${pkgs.zfs}/bin/zfs list -H -t snapshot -o name /var/lib | sort | tail -1) /var/lib/.snapshot-latest ''; backupCleanupCommand = '' + set -euo pipefail ${pkgs.util-linux}/bin/umount /var/lib/.snapshot-latest ''; timerConfig = {