From 58607b16f5dfac02e4175155ca04ea494bcad14a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 15 Apr 2014 01:17:58 +0200 Subject: housekeeping: correctly report disk+filetype usage for a job category --- bin/housekeeping.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bin/housekeeping.sh') diff --git a/bin/housekeeping.sh b/bin/housekeeping.sh index 5b8ef433..3d93a717 100755 --- a/bin/housekeeping.sh +++ b/bin/housekeeping.sh @@ -30,13 +30,12 @@ check_for_mounted_chroots() { } report_disk_usage() { - du -schx /var/lib/jenkins/jobs/${1}_* |grep total |sed -s "s#total#${1} jobs#" - # FIXME: if $2 is given check, that disk usage is below $2 GB - same for report_filetype_usage() + du -schx /var/lib/jenkins/jobs/${1}* |grep total |sed -s "s#total#${1} jobs#" } report_filetype_usage() { OUTPUT=$(mktemp) - find /var/lib/jenkins/jobs/${1}_* -type f -name "*.${2}" 2>/dev/null|xargs -r du -sch |grep total |sed -s "s#total#$1 .$2 files#" > $OUTPUT + find /var/lib/jenkins/jobs/${1}* -type f -name "*.${2}" 2>/dev/null|xargs -r du -sch |grep total |sed -s "s#total#$1 .$2 files#" > $OUTPUT if [ "$3" = "warn" ] && [ -s $OUTPUT ] ; then echo "Warning: there are $2 files and there should not be any." cat $OUTPUT -- cgit v1.2.3-54-g00ecf