hippocampus: backups: clear old gitea backups
This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
{ ... }: {
|
||||
{ pkgs, config, ... }: {
|
||||
services.gitea.dump = {
|
||||
enable = true;
|
||||
interval = "2:45";
|
||||
};
|
||||
systemd.timers."gitea-clear-dump" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
Unit = "gitea-clear-dump.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."gitea-clear-dump" = {
|
||||
script = ''
|
||||
${pkgs.findutils}/bin/find /var/lib/gitea/dump -type f -ctime +5 -exec rm -f {} \;
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = config.services.gitea.user;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user