[Git][qa/jenkins.debian.net][master] r.d.n: add script to work around/implement a missing feature of debrebuild
Holger Levsen (@holger)
gitlab at salsa.debian.org
Mon Mar 3 10:44:55 GMT 2025
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
2db5e985 by Holger Levsen at 2025-03-03T11:44:43+01:00
r.d.n: add script to work around/implement a missing feature of debrebuild
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- + bin/debrebuild_cache_limiter.sh
Changes:
=====================================
bin/debrebuild_cache_limiter.sh
=====================================
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# Copyright 2025 Holger Levsen (holger at layer-acht.org)
+# released under the GPLv2
+
+CACHE=~rebuilderd/cache
+
+if [ ! -d $CACHE ] ; then
+ echo "$CACHE does not exist."
+ exit 1
+fi
+
+case $HOSTNAME in
+ ionos17*) LIMIT=50 ;;
+ codethink*) LIMIT=20 ;;
+ osuosl*) LIMIT=333 ;;
+ infom07*) LIMIT=200 ;; # FIXME: drop extra partition again?
+ infom08*) LIMIT=100 ;;
+ riscv64*) LIMIT=180 ;;
+ *) echo "Limit for $HOSTNAME not defined."
+ exit 1 ;;
+esac
+
+# delete 1000 oldest files
+# FIXME: use atime, but then, this script should not exist in the first place... :)
+find $CACHE -type f -printf '%T+ %p\n' | sort | head -n 1000|cut -d ' ' -f2-|xargs sudo rm
+
+set -e
+set -o pipefail
+
+SIZE=$(du -sh $CACHE | grep G | cut -d 'G' -f 1)
+
+if [ $SIZE -gt $LIMIT ] ; then
+ echo "$CACHE is still ${SIZE}G, reducing further."
+ $0
+else
+ echo "$CACHE is ${SIZE}G, voila."
+fi
+
+exit 0
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/2db5e98507eb42c5438d3fc2b85aced2f3623e69
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/2db5e98507eb42c5438d3fc2b85aced2f3623e69
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/20250303/637530ef/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list