website: Clear old generations on dev
With https://github.com/chaos-jetzt/website_pelican/pull/33, a lot of orphans are to be expected which will take up space on our servers. This introduces a timer which runs once a week and will delete any website generations older than 28 days.
This commit is contained in:
parent
5442317071
commit
c1eebe17dc
1 changed files with 10 additions and 0 deletions
|
@ -82,4 +82,14 @@ in {
|
||||||
chown -R web-deploy:${config.services.nginx.group} ${webroot}
|
chown -R web-deploy:${config.services.nginx.group} ${webroot}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Delete dev website builds older than 28 days
|
||||||
|
systemd.services."website-purge-old" = lib.mkIf isDev {
|
||||||
|
path = with pkgs; [ fd ];
|
||||||
|
script = ''
|
||||||
|
fd --print0 --changed-before 28d --type d --max-depth 1 --min-depth 1 . ${webroot} --exec-batch rm -vr {} \;
|
||||||
|
'';
|
||||||
|
startAt = "weekly";
|
||||||
|
serviceConfig.User = "web-deploy";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue