Commit e5b31286 authored by Holger Levsen's avatar Holger Levsen
Browse files

jenkins-shell-monitor.sh: improve those directory stats

parent 00400ad4
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -76,10 +76,29 @@ main_loop() {
				WIDTH=5
			fi
			printf  "%-45s %-5s %-${WIDTH}s %s\n" $FILESYSTEM_MOUNTPOINT $FILESYSTEM_SIZE $FILESYSTEM_AVAIL $FILESYSTEM_USAGE
		done
			# include some directory stats which have been problematic in the past
		du -sh /srv/reproducible-results/rbuild-debian 2>/dev/null
		( cd /var/lib/jenkins/userContent/reproducible/debian ; du -sh dbdtxt/stretch/ dbdtxt/buster/ dbdjson/stretch/ dbdjson/buster/ 2>/dev/null )
			case $FILESYSTEM in
				"/dev/vda1")
					DIR_PATH=/srv/reproducible-results/rbuild-debian
					DU=$(du -sh $DIR_PATH 2>/dev/null | awk '{ print $1 }')
					if [ -n "$(echo $DU | grep -E '[0-9]{3}G')" ] ; then
						DIR_USAGE="${YELLOW}$DU${FOREGROUND_COLOR}"
						WIDTH=16
					else
						DIR_USAGE=$DU
						WIDTH=5
					fi
					printf  "%-45s %-5s %-${WIDTH}s %s\n" "  $DIR_PATH" "" "" $DIR_USAGE
					;;
				"/var/lib/jenkins/userContent/reproducible")
					DIR_PATH=/var/lib/jenkins/userContent/reproducible/debian
					for i in stretch buster bullseye bookworm unstable experimental ; do
					  DIR_USAGE=$(cd $DIR_PATH ; du -ch dbd*/$i  2>/dev/null | grep total | awk '{ print $1 }')
					  printf  "%-45s %-5s %-${WIDTH}s %s\n" "  r-b-userContent../dbd*/$i" "" "" $DIR_USAGE
					done
					;;
			esac
		done
	) > $DISKSTATS
	SOME_AGE="$(date -u)"
	for i in $SEQ1 ; do