diff options
author | Helmut Grohne <helmut@subdivi.de> | 2015-02-16 13:10:02 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2015-02-16 13:10:02 +0100 |
commit | 63cc00aa9026e4b2162585e9bb544356fcf09361 (patch) | |
tree | fa45bc7205955365a614e6c73b393b34de1554c5 /bin | |
parent | ef58d7e277715b2efbbb2d7f6dfb8239fbb4d586 (diff) | |
download | jenkins.debian.net-63cc00aa9026e4b2162585e9bb544356fcf09361.tar.xz |
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.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/maintainance.sh | 6 |
1 files changed, 6 insertions, 0 deletions
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 } |