summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-06-20 18:54:10 +0200
committerHolger Levsen <holger@layer-acht.org>2017-06-20 18:54:10 +0200
commit86f794f3eeb72a04a8cf8d3744002f46597d9607 (patch)
treecb82405c96d36acfa330dcd41e61520cd63d386a /bin
parent547203d0b6022ff688a957a8c2b8b6da64b4c1d9 (diff)
downloadjenkins.debian.net-86f794f3eeb72a04a8cf8d3744002f46597d9607.tar.xz
reproducible Debian: delete old stuff first, so that deletes still happen even if updates fail later
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_maintenance.sh56
1 files changed, 30 insertions, 26 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index d5f0c103..c5beb35a 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -58,6 +58,36 @@ fi
set -e
#
+# delete old temp directories
+#
+echo "$(date -u) - Deleting temp directories, older than 3 days."
+OLDSTUFF=$(find $REP_RESULTS/rbuild-debian -maxdepth 1 -type d -mtime +2 -name "tmp.*" -exec ls -lad {} \; || true)
+if [ ! -z "$OLDSTUFF" ] ; then
+ echo
+ echo "Old temp directories found in $REP_RESULTS/rbuild-debian"
+ find $REP_RESULTS/rbuild-debian -maxdepth 1 -type d -mtime +2 -name "tmp.*" -exec rm -rv {} \; || true
+ echo "These old directories have been deleted."
+ echo
+ DIRTY=true
+fi
+
+#
+# delete old pbuilder build directories
+#
+if [ -d /srv/workspace/pbuilder/ ] ; then
+ echo "$(date -u) - Deleting pbuilder build directories, older than 3 days."
+ OLDSTUFF=$(find /srv/workspace/pbuilder/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true)
+ if [ ! -z "$OLDSTUFF" ] ; then
+ echo
+ echo "Old pbuilder build directories found in /srv/workspace/pbuilder/"
+ echo -n "$OLDSTUFF"
+ find /srv/workspace/pbuilder/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true
+ echo
+ DIRTY=true
+ fi
+fi
+
+#
# check for working proxy
#
echo "$(date -u) - testing whether the proxy works..."
@@ -139,32 +169,6 @@ if [ "$HOSTNAME" = "${ARCHLINUX_BUILD_NODE}" ] ; then
fi
set -e
-# delete old temp directories
-echo "$(date -u) - Deleting temp directories, older than 3 days."
-OLDSTUFF=$(find $REP_RESULTS/rbuild-debian -maxdepth 1 -type d -mtime +2 -name "tmp.*" -exec ls -lad {} \; || true)
-if [ ! -z "$OLDSTUFF" ] ; then
- echo
- echo "Old temp directories found in $REP_RESULTS/rbuild-debian"
- find $REP_RESULTS/rbuild-debian -maxdepth 1 -type d -mtime +2 -name "tmp.*" -exec rm -rv {} \; || true
- echo "These old directories have been deleted."
- echo
- DIRTY=true
-fi
-
-# delete old pbuilder build directories
-if [ -d /srv/workspace/pbuilder/ ] ; then
- echo "$(date -u) - Deleting pbuilder build directories, older than 3 days."
- OLDSTUFF=$(find /srv/workspace/pbuilder/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true)
- if [ ! -z "$OLDSTUFF" ] ; then
- echo
- echo "Old pbuilder build directories found in /srv/workspace/pbuilder/"
- echo -n "$OLDSTUFF"
- find /srv/workspace/pbuilder/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true
- echo
- DIRTY=true
- fi
-fi
-
# delete build services logfiles
if [ "$HOSTNAME" = "$MAINNODE" ] ; then
if [ -d /var/lib/jenkins/userContent/reproducible/debian/build_service/ ] ; then