From 27dc20dd04c7398aa0e1ce2fd0dfcac4f7445311 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sun, 25 Aug 2024 03:29:25 +0200 Subject: [PATCH] obs-portal: add backups to garage bucket + storagebox Restic backups to garage S3 bucket nachtigall-backups --- modules/obs-portal/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/obs-portal/default.nix b/modules/obs-portal/default.nix index e2733bf..dfd5793 100644 --- a/modules/obs-portal/default.nix +++ b/modules/obs-portal/default.nix @@ -147,4 +147,26 @@ in }; }; }; + + pub-solar-os.backups.restic.obs-portal = { + paths = [ + "/var/lib/obs-portal/data" + "/tmp/obs-portal-backup.sql" + ]; + timerConfig = { + OnCalendar = "*-*-* 00:30:00 Etc/UTC"; + }; + initialize = true; + backupPrepareCommand = '' + ${pkgs.docker}/bin/docker exec -ti --user postgres obs-portal-db pg_dump obs > /tmp/obs-portal-backup.sql + ''; + backupCleanupCommand = '' + rm /tmp/obs-portal-backup.sql + ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; + }; }