From 484bcd10e2ceb5303c95e7184ef095f701e85168 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 4 Nov 2013 09:56:33 +0100 Subject: [PATCH] hydra-module/compressLogs: Avoid creating /root/r. We really don't need to touch a file in the current working directory to find files that are older than one month. Since findutils 4.3.3 there is a -newerXY option which allows to specify timestamps directly (as with `date --date`). But even when using a reference file, it really causes confusion if people look into /root and try to debug where that misterious "r" file is coming from. Signed-off-by: aszlig --- hydra-module.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hydra-module.nix b/hydra-module.nix index a796663d..1b8d8663 100644 --- a/hydra-module.nix +++ b/hydra-module.nix @@ -270,9 +270,10 @@ in ''; compressLogs = pkgs.writeScript "compress-logs" '' - #! ${pkgs.stdenv.shell} -e - touch -d 'last month' r - find /nix/var/log/nix/drvs -type f -a ! -newer r -name '*.drv' | xargs bzip2 -v + #! ${pkgs.stdenv.shell} -e + find /nix/var/log/nix/drvs \ + -type f -a ! -newermt 'last month' \ + -name '*.drv' -exec bzip2 -v {} + ''; in [ "*/5 * * * * root ${checkSpace} &> ${baseDir}/data/checkspace.log"