summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-04-15 01:17:58 +0200
committerHolger Levsen <holger@layer-acht.org>2014-04-15 01:17:58 +0200
commit58607b16f5dfac02e4175155ca04ea494bcad14a (patch)
treefef69abe3be813e6db17bdc1fa302418fa909170
parent9dbb0fc3a6bb4a178fed8f50b0149e856e4fce86 (diff)
downloadjenkins.debian.net-58607b16f5dfac02e4175155ca04ea494bcad14a.tar.xz
housekeeping: correctly report disk+filetype usage for a job category
-rwxr-xr-xbin/housekeeping.sh5
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