From a9411d05a81936f1ffc49497ad9f833495074850 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Mon, 22 Apr 2024 20:06:49 +0200 Subject: [PATCH] set pruneOpts for restic backups to daily 7, weekly 4, monthly 3 --- hosts/nachtigall/apps/forgejo.nix | 10 ++++++++++ hosts/nachtigall/apps/keycloak.nix | 10 ++++++++++ hosts/nachtigall/apps/mailman.nix | 10 ++++++++++ hosts/nachtigall/apps/mastodon.nix | 10 ++++++++++ hosts/nachtigall/apps/matrix/synapse.nix | 5 +++++ hosts/nachtigall/apps/nextcloud.nix | 10 ++++++++++ 6 files changed, 55 insertions(+) diff --git a/hosts/nachtigall/apps/forgejo.nix b/hosts/nachtigall/apps/forgejo.nix index 50c8e516..397503d9 100644 --- a/hosts/nachtigall/apps/forgejo.nix +++ b/hosts/nachtigall/apps/forgejo.nix @@ -190,6 +190,11 @@ backupCleanupCommand = '' rm /tmp/forgejo-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; services.restic.backups.forgejo-storagebox = { @@ -209,5 +214,10 @@ backupCleanupCommand = '' rm /tmp/forgejo-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; } diff --git a/hosts/nachtigall/apps/keycloak.nix b/hosts/nachtigall/apps/keycloak.nix index a1942764..81b46ec5 100644 --- a/hosts/nachtigall/apps/keycloak.nix +++ b/hosts/nachtigall/apps/keycloak.nix @@ -64,6 +64,11 @@ backupCleanupCommand = '' rm /tmp/keycloak-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; services.restic.backups.keycloak-storagebox = { @@ -82,5 +87,10 @@ backupCleanupCommand = '' rm /tmp/keycloak-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; } diff --git a/hosts/nachtigall/apps/mailman.nix b/hosts/nachtigall/apps/mailman.nix index 0c054838..01ea8cc2 100644 --- a/hosts/nachtigall/apps/mailman.nix +++ b/hosts/nachtigall/apps/mailman.nix @@ -94,6 +94,11 @@ initialize = true; passwordFile = config.age.secrets."restic-repo-droppie".path; repository = "sftp:yule@droppie.b12f.io:/media/internal/pub.solar"; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; services.restic.backups.mailman-storagebox = { @@ -109,5 +114,10 @@ initialize = true; passwordFile = config.age.secrets."restic-repo-storagebox".path; repository = "sftp:u377325@u377325.your-storagebox.de:/backups"; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; } diff --git a/hosts/nachtigall/apps/mastodon.nix b/hosts/nachtigall/apps/mastodon.nix index e194d9bb..3df8efd5 100644 --- a/hosts/nachtigall/apps/mastodon.nix +++ b/hosts/nachtigall/apps/mastodon.nix @@ -114,6 +114,11 @@ backupCleanupCommand = '' rm /tmp/mastodon-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; services.restic.backups.mastodon-storagebox = { @@ -132,5 +137,10 @@ backupCleanupCommand = '' rm /tmp/mastodon-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; } diff --git a/hosts/nachtigall/apps/matrix/synapse.nix b/hosts/nachtigall/apps/matrix/synapse.nix index 3dd71eef..dd799100 100644 --- a/hosts/nachtigall/apps/matrix/synapse.nix +++ b/hosts/nachtigall/apps/matrix/synapse.nix @@ -312,5 +312,10 @@ in backupCleanupCommand = '' rm /tmp/matrix-synapse-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; } diff --git a/hosts/nachtigall/apps/nextcloud.nix b/hosts/nachtigall/apps/nextcloud.nix index 411d8725..bed4c04d 100644 --- a/hosts/nachtigall/apps/nextcloud.nix +++ b/hosts/nachtigall/apps/nextcloud.nix @@ -150,6 +150,11 @@ backupCleanupCommand = '' rm /tmp/nextcloud-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; services.restic.backups.nextcloud-storagebox = { @@ -169,5 +174,10 @@ backupCleanupCommand = '' rm /tmp/nextcloud-backup.sql ''; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 4" + "--keep-monthly 3" + ]; }; }