From dd1b2b0638e351fcff7e9fc4b253203687e8914d Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 1 Jul 2023 16:29:29 +0800 Subject: [PATCH] hosts/plover: fix Gitea dump cleanup --- hosts/plover/modules/services/gitea.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/plover/modules/services/gitea.nix b/hosts/plover/modules/services/gitea.nix index 7b95a075..24ede24c 100644 --- a/hosts/plover/modules/services/gitea.nix +++ b/hosts/plover/modules/services/gitea.nix @@ -115,7 +115,8 @@ in # with 2 dumps. systemd.services.gitea-dump.preStart = lib.mkAfter '' ${pkgs.findutils}/bin/find ${lib.escapeShellArg config.services.gitea.dump.backupDir} \ - -mtime 14 -maxdepth 1 -type f -delete + -maxdepth 1 -type f -iname '*.${config.services.gitea.dump.type}' -ctime 21 \ + | tail -n -3 | xargs rm ''; # Making sure this plays nicely with the database service of choice. Take