aboutsummaryrefslogtreecommitdiff
path: root/vps-configuration.env.nix
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-30 20:26:10 -0300
committerEuAndreh <eu@euandre.org>2020-08-30 20:44:36 -0300
commit5c278ff4c6e5d3615f41b0c98ea4e957e42136b8 (patch)
treea52e8978bb99a6eebd431cdf95c610d84d674247 /vps-configuration.env.nix
parentAdd prototype of logrotate configuration (diff)
downloadserver-5c278ff4c6e5d3615f41b0c98ea4e957e42136b8.tar.gz
server-5c278ff4c6e5d3615f41b0c98ea4e957e42136b8.tar.xz
Add poor-mans-logrotate service to gc old log files
Diffstat (limited to 'vps-configuration.env.nix')
-rw-r--r--vps-configuration.env.nix32
1 files changed, 22 insertions, 10 deletions
diff --git a/vps-configuration.env.nix b/vps-configuration.env.nix
index 6411720..8bf103e 100644
--- a/vps-configuration.env.nix
+++ b/vps-configuration.env.nix
@@ -313,17 +313,17 @@ in {
logrotate = {
enable =
false; # disabled due to extraConfig not being yet out of unstable
- extraConfig = ''
- compress
+ # extraConfig = ''
+ # compress
- ${envsubstConfiguration.ciLogsRoot}/*/*.log {
- rotate 5
- daily
- olddir ${envsubstConfiguration.staticRoot}/logrorate/
- createolddir 744 andreh users
- su andreh users
- }
- '';
+ # ${envsubstConfiguration.ciLogsRoot}/*/*.log {
+ # rotate 5
+ # daily
+ # olddir ${envsubstConfiguration.staticRoot}/logrorate/
+ # createolddir 744 andreh users
+ # su andreh users
+ # }
+ # '';
};
};
@@ -350,6 +350,18 @@ in {
]);
serviceConfig = { Type = "oneshot"; };
};
+ "poor-mans-logrotate" = {
+ enable = true;
+ description = "Delete old CI log files";
+ wantedBy = [ "multi-user.target" ];
+ script = ''
+ pushd ${envsubstConfiguration.ciLogsRoot}
+ find . -type f -name '*.log' -mtime 1 -delete
+ find . -type d -empty -delete
+ ${pkgs.bash}/bin/bash ci-gen-index.sh
+ '';
+ serviceConfig = { Type = "oneshot"; };
+ };
"pires-prod" = {
enable = true;
# Unit