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 <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2013-11-04 09:56:33 +01:00 committed by Rob Vermaas
parent 647d6bc3f1
commit 484bcd10e2

View file

@ -270,9 +270,10 @@ in
''; '';
compressLogs = pkgs.writeScript "compress-logs" '' compressLogs = pkgs.writeScript "compress-logs" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.stdenv.shell} -e
touch -d 'last month' r find /nix/var/log/nix/drvs \
find /nix/var/log/nix/drvs -type f -a ! -newer r -name '*.drv' | xargs bzip2 -v -type f -a ! -newermt 'last month' \
-name '*.drv' -exec bzip2 -v {} +
''; '';
in in
[ "*/5 * * * * root ${checkSpace} &> ${baseDir}/data/checkspace.log" [ "*/5 * * * * root ${checkSpace} &> ${baseDir}/data/checkspace.log"