[Git][qa/jenkins.debian.net][master] jenkins shell monitor: use /usr/bin/du --apparent-size

Holger Levsen (@holger) gitlab at salsa.debian.org
Sat Feb 10 12:22:46 GMT 2024



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
fd54c037 by Holger Levsen at 2024-02-10T13:10:32+01:00
jenkins shell monitor: use /usr/bin/du --apparent-size

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/jenkins-shell-monitor.sh


Changes:

=====================================
bin/jenkins-shell-monitor.sh
=====================================
@@ -1,7 +1,7 @@
 #!/bin/bash
 # vim: set noexpandtab:
 
-# Copyright © 2020-2023 Holger Levsen (holger at layer-acht.org)
+# Copyright © 2020-2024 Holger Levsen (holger at layer-acht.org)
 # released under the GPLv2
 #
 #
@@ -77,7 +77,7 @@ main_loop() {
 			case $FILESYSTEM in
 				"/dev/vda1")
 					for DIR_PATH in /var/lib/jenkins /var/lib/schroot /srv/schroots /srv/reproducible-results/rbuild-debian ; do
-						DU=$(sudo du -shx $DIR_PATH 2>/dev/null | awk '{ print $1 }')
+						DU=$(sudo du -shx --apparent-size $DIR_PATH 2>/dev/null | awk '{ print $1 }')
 						if [ -n "$(echo $DU | grep G)" ] && [ -n "${WARNING_LEVEL[$DIR_PATH]}" ] && [ "${WARNING_LEVEL[$DIR_PATH]}" -lt "$(echo $DU | cut -d 'G' -f1 | cut -d '.' -f1)" ] ; then
 							DIR_USAGE="${YELLOW}$DU${FOREGROUND_COLOR}"
 						else
@@ -96,7 +96,7 @@ main_loop() {
 							DU_PATH="dbd*/$i"
 							VISIBLE_PATH="r-b-userContent../dbd*/$i"
 						fi
-						DU=$(cd $DIR_PATH ; du -ch ${DU_PATH} 2>/dev/null | grep total | awk '{ print $1 }')
+						DU=$(cd $DIR_PATH ; du -ch --apparent-size ${DU_PATH} 2>/dev/null | grep total | awk '{ print $1 }')
 						if [ -n "$(echo $DU | grep G)" ] && [ -n "${WARNING_LEVEL[$VISIBLE_PATH]}" ] && [ "${WARNING_LEVEL[$VISIBLE_PATH]}" -lt "$(echo $DU | cut -d 'G' -f1 | cut -d '.' -f1)" ] ; then
 							DIR_USAGE="${YELLOW}$DU${FOREGROUND_COLOR}"
 						else



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/fd54c037de7637ed380bdadc4a40fde4ebfadaad

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/fd54c037de7637ed380bdadc4a40fde4ebfadaad
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20240210/5e8e848a/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list