From 20022f9a6d5f4f1a11d5b195d7a05ce648e994d0 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Fri, 10 Jun 2022 19:47:47 -0400 Subject: [PATCH] Use sql dump service instead --- machines/oracles.nix | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/machines/oracles.nix b/machines/oracles.nix index 09dd6b0..c7b373f 100644 --- a/machines/oracles.nix +++ b/machines/oracles.nix @@ -80,7 +80,7 @@ }; environment.BORG_RSH = "ssh -i ${config.sops.secrets."borg-sshKey".path}"; compression = "auto,zstd"; - startAt = "hourly"; + startAt = "OnCalendar=00/4:00"; prune.keep = { within = "7d"; # Keep all archives for the past week daily = 1; # Keep 1 snapshot a day for 2 weeks @@ -88,31 +88,13 @@ monthly = -1; # Keep unlimited monthly backups }; }; - postgres = - let dumper = pkgs.writeScript "pg-dumper" - '' - #!/usr/bin/env bash - su -c postgres pg_dumpall - ''; - in - { - - dumpCommand = dumper; - repo = "de1955@de1955.rsync.net:databases/oracles/postgres"; - encryption = { - mode = "repokey-blake2"; - passCommand = "cat ${config.sops.secrets."borg-oraclesPassword".path}"; - }; - environment.BORG_RSH = "ssh -i ${config.sops.secrets."borg-sshKey".path}"; - compression = "auto,zstd"; - startAt = "hourly"; - prune.keep = { - within = "7d"; # Keep all archives for the past week - daily = 1; # Keep 1 snapshot a day for 2 weeks - weekly = 4; # Keep 1 snapshot a week for 4 weeks - monthly = -1; # Keep unlimited monthly backups - }; - }; + }; + # Backup postgres + services.postgresqlBackup = { + enable = true; + compression = "none"; + backupAll = true; + startAt = "OnCalendar=00/2:00"; }; }