diff options
author | Holger Levsen <holger@layer-acht.org> | 2014-04-15 01:17:58 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-04-15 01:17:58 +0200 |
commit | 58607b16f5dfac02e4175155ca04ea494bcad14a (patch) | |
tree | fef69abe3be813e6db17bdc1fa302418fa909170 | |
parent | 9dbb0fc3a6bb4a178fed8f50b0149e856e4fce86 (diff) | |
download | jenkins.debian.net-58607b16f5dfac02e4175155ca04ea494bcad14a.tar.xz |
housekeeping: correctly report disk+filetype usage for a job category
-rwxr-xr-x | bin/housekeeping.sh | 5 |
1 files changed, 2 insertions, 3 deletions
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 |