From 63cc00aa9026e4b2162585e9bb544356fcf09361 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 16 Feb 2015 13:10:02 +0100 Subject: compress rebootstrap logs in rebootstrap_maintenance jenkins already knows how to transparently decompress gzip-compressed logs. It does not have any mechanism to do the compression on its own though. Thus compress the large rebootstrap plaintext logs after being unmodified for 1 day. --- bin/maintainance.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bin/maintainance.sh') diff --git a/bin/maintainance.sh b/bin/maintainance.sh index 396da6a5..e5d5f18c 100755 --- a/bin/maintainance.sh +++ b/bin/maintainance.sh @@ -35,12 +35,18 @@ chroot_checks() { } remove_old_rebootstrap_logs() { + local OLDSTUFF COMPRESSED # delete old html logs to save space OLDSTUFF=$(find /var/lib/jenkins/jobs/rebootstrap_* -maxdepth 3 -mtime +7 -name log_content.html -exec rm -v {} \;) if [ ! -z "$OLDSTUFF" ] ; then echo "Old html logs have been deleted:" echo "$OLDSTUFF" fi + COMPRESSED=$(find /var/lib/jenkins/jobs/rebootstrap_* -maxdepth 3 -mindepth 3 -mtime +1 -name log -exec gzip -9 -v {} \;) + if [ ! -z "$COMPRESSED" ] ; then + echo "Logs have been compressed:" + echo "$COMPRESSED" + fi } -- cgit v1.2.3-54-g00ecf