stop failing on all the trac backups if just one fails
authorMicah Anderson <micah@riseup.net>
Wed, 25 Jun 2008 03:27:06 +0000 (03:27 +0000)
committerMicah Anderson <micah@riseup.net>
Wed, 25 Jun 2008 03:27:06 +0000 (03:27 +0000)
ChangeLog
handlers/trac.in

index 346120002cfaa9eaeb75ba5c9ed7fb29df259b6c..73a38f1aded396be1d70326a2bf0ea85ae583b0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,9 @@ version 0.9.6 -- unreleased
         . Added more robust software RAID information capture by running mdadm
           -Q --detail /dev/md?* because some people may have empty mdadm.conf files
           (Thanks to John Hallam).
         . Added more robust software RAID information capture by running mdadm
           -Q --detail /dev/md?* because some people may have empty mdadm.conf files
           (Thanks to John Hallam).
+       trac:
+        . stop failing on all the trac backups if just one fails, this means
+          removing the temporary trac backup directories if they fail
 
 version 0.9.5 -- December 2, 2007
     backupninja changes
 
 version 0.9.5 -- December 2, 2007
     backupninja changes
index 0460c9ff24bd35a17eaeab018b9da7c9ef98458d..a4b7bdf72b79f800740bf4fffb8e2132615e37c0 100644 (file)
@@ -9,7 +9,6 @@ getconf src /var/lib/trac
 getconf dest /var/backups/trac
 getconf tmp /var/backups/trac.tmp
 
 getconf dest /var/backups/trac
 getconf tmp /var/backups/trac.tmp
 
-error=0
 cd $src
 for repo in `find . -name VERSION`
 do
 cd $src
 for repo in `find . -name VERSION`
 do
@@ -38,19 +37,14 @@ do
     fi
     if [ $code != 0 ]; then
        error "command failed -- trac-admin $src/$repo hotcopy $tmp/$repo"
     fi
     if [ $code != 0 ]; then
        error "command failed -- trac-admin $src/$repo hotcopy $tmp/$repo"
-       error=1
     fi
 done
 
     fi
 done
 
-if [ $error -eq 1 ]; then
-    echo "Error: because of earlier errors, we are leaving trac backups in $tmp instead of $dest"
-else
-    if [ -d $dest -a -d $tmp ]; then
-        rm -rf $dest
-    fi
-    if [ -d $tmp ]; then
-        mv $tmp $dest
-    fi
+if [ -d $dest -a -d $tmp ]; then
+     rm -rf $dest
+fi
+if [ -d $tmp ]; then
+     mv $tmp $dest
 fi
 
 exit 0
 fi
 
 exit 0