hosts/plover: update dump limit script

This commit is contained in:
Gabriel Arazas 2023-02-07 09:47:01 +08:00
parent 2d7abe51d4
commit c508d7a30d
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -106,11 +106,10 @@ in
# Disk space is always assumed to be limited so we're really only limited
# with 2 dumps.
systemd.services.gitea-dump.serviceConfig = {
ExecStartPre = pkgs.writeShellScript "gitea-dump-limit" ''
${pkgs.findutils}/bin/find ${config.services.gitea.dump.backupDir} -mtime 14 -maxdepth 1 -type f -delete
'';
};
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
'';
# Making sure this plays nicely with the database service of choice. Take
# note, we're mainly using secure schema usage pattern here as described from