From e3debea7d3de38a9c07e2d398669810eb3a9c985 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 28 Nov 2015 11:17:38 +0100 Subject: reproducible: actually do what the comments say, remove stuff older than 2 days --- bin/reproducible_maintenance.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 50bef4e7..19da9311 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -103,11 +103,11 @@ set -e # delete old temp directories echo "$(date -u) - Deleting temp directories, older than 2 days." -OLDSTUFF=$(find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec ls -lad {} \; || true) +OLDSTUFF=$(find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +1 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Old temp directories found in $REP_RESULTS" - find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec rm -rv {} \; || true + find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +1 -exec rm -rv {} \; || true echo "These old directories have been deleted." echo DIRTY=true @@ -115,12 +115,12 @@ fi # delete old pbuilder build directories echo "$(date -u) - Deleting pbuilder build directories, older than 2 days." -OLDSTUFF=$(find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true) +OLDSTUFF=$(find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +1 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Old temp directories found in $REP_RESULTS" echo -n "$OLDSTUFF" - find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true + find /srv/workspace/pbuilder/ -maxdepth 1 -regex '.*/[0-9]+' -type d -mtime +1 -exec sudo rm -rf --one-file-system {} \; || true echo DIRTY=true fi @@ -131,13 +131,13 @@ cleanup_schroot_sessions # find old schroots echo "$(date -u) - Removing schroots older than 2 days." -OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \; || true) +OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +1 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "schroots older than 2 days found in /schroots, which will be deleted:" - find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true + find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +1 -exec sudo rm -rf --one-file-system {} \; || true echo "$OLDSTUFF" - OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +2 -exec ls -lad {} \; || true) + OLDSTUFF=$(find /schroots/ -maxdepth 1 -type d -regextype posix-extended -regex "/schroots/reproducible-.*-[0-9]{1,5}" -mtime +1 -exec ls -lad {} \; || true) if [ ! -z "$OLDSTUFF" ] ; then echo echo "Warning: Tried, but failed to delete these:" -- cgit v1.2.3-70-g09d2