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

reproducible & everything: warn on files >8G in /var/log and fail maintenance...


reproducible & everything: warn on files >8G in /var/log and fail maintenance job if files >32G are found

Signed-off-by: default avatarHolger Levsen <holger@layer-acht.org>
parent 43fa8d16
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -57,6 +57,23 @@ fi
#
set -e

#
# find too large files in /var/log
#
echo "$(date -u) - Looking for too large files in /var/log/"
TOOBIG=$(find /var/log -size +8G -exec ls -lah {} \; 2>/dev/null || true)
if [ ! -z "$TOOBIG" ] ; then
	echo
	echo "$(date -u) - Warning: too large files found in /var/log:"
	echo "$TOOBIG"
	echo
	DIRTY=true
	if $(find /var/log -size +32G /dev/null 2>&1) ; then
		echo "$(date -u) - Error, more than 32gb is just wrong..."
		exit 1
	fi
fi

#
# delete old temp directories
#