[Git][qa/jenkins.debian.net][master] rdn: make script more robust
Holger Levsen (@holger)
gitlab at salsa.debian.org
Thu Apr 17 17:19:09 BST 2025
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
024c0921 by Holger Levsen at 2025-04-17T18:18:53+02:00
rdn: make script more robust
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/debrebuild_cache_limiter.sh
Changes:
=====================================
bin/debrebuild_cache_limiter.sh
=====================================
@@ -20,17 +20,17 @@ case $HOSTNAME in
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)
+SIZE=$(du -sh $CACHE | grep G | cut -d 'G' -f 1||echo 0)
if [ $SIZE -gt $LIMIT ] ; then
echo "$CACHE is still ${SIZE}G, reducing further."
+ # delete 1000 oldest files
+ # FIXME: use atime, but then, this script should not exist in the first place... :)
+ set -e
+ set -o pipefail
+ find $CACHE -type f -printf '%T+ %p\n' | sort | head -n 1000|cut -d ' ' -f2-|xargs sudo rm -f
$0
else
echo "$CACHE is ${SIZE}G, voila."
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/024c0921079c642c482adcb485a05f68b3d1405f
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/024c0921079c642c482adcb485a05f68b3d1405f
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/20250417/cc4ffbc9/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list