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

rdn: deal gracefully with no backups for the day and some refactoring too

parent e6fdb608
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -10,12 +10,11 @@ if [ ! -d $CACHE ] ; then
	exit 1
fi

LIMIT=100
case $HOSTNAME in
	ionos17*)		LIMIT=50  ;;
	codethink*)		LIMIT=12  ;;
	osuosl*-amd64)		LIMIT=333 ;;
	osuosl*-ppc64el)	LIMIT=100 ;;
	infom07*|infom08*)	LIMIT=100 ;;
	riscv64*)		LIMIT=180 ;;
	*)		echo "Limit for $HOSTNAME not defined."
			exit 1 ;;
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ set -e

# actually compress those backups
TODAY=$(date '+%Y-%m-%d' -u)
FILES=$(find /srv/rebuilderd/*/stats/db-backup/db-back-$TODAY -type f ! -name '*.zst' ! -name '*.xz')
FILES=$(find /srv/rebuilderd/*/stats/db-backup/db-back-$TODAY -type f ! -name '*.zst' ! -name '*.xz' 2>/dev/null || exit 0)
for i in $FILES ; do
	zstdmt --rm -4 $i
done