ldap,mysql,pgsql: use bash pipefail option so that failed dumps are reported as such
[matthijs/upstream/backupninja.git] / handlers / ldap.in
index 5f402c744ae3fb93065bb82068a3a54cfabbd5a4..fda24d08878304f044821d08c5608cfde171402f 100644 (file)
@@ -86,12 +86,12 @@ if [ "$ldif" == "yes" ]; then
          fi
 
          if [ "$compress" == "yes" ]; then
-            execstr="$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz"
+            execstr="$execstr | $GZIP --rsyncable > $dumpdir/$dbsuffix.ldif.gz"
          else
             execstr="$execstr > $dumpdir/$dbsuffix.ldif"
          fi
          debug "$execstr"
-         output=`su root -c "$execstr" 2>&1`
+         output=`su root -c "set -o pipefail ; $execstr" 2>&1`
          code=$?
          if [ "$code" == "0" ]; then
             debug $output