X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fmysql;h=a19509bf062545b0192b42db6974d49fa9a5d060;hb=b5130c49410c6c1300b9c8f6246a61c4d1e66004;hp=2dcf2d5a936e5d11b7982ec380ff7dde46dffb3c;hpb=a21b0685484c50d84c79cc1fe8bd1bb7d50c98f3;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/mysql b/handlers/mysql index 2dcf2d5..a19509b 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -179,7 +179,7 @@ then else execstr="$MYSQLHOTCOPY --quiet --allowold --regexp /.\*/./.\*/ $hotdir" fi - debug 'su $user -c "$execstr"' + debug "su $user -c \"$execstr\"" if [ ! $test ] then output=`su $user -c "$execstr" 2>&1` @@ -202,7 +202,7 @@ then else execstr="$MYSQLHOTCOPY --allowold $db $hotdir" fi - debug 'su $user -c "$execstr"' + debug 'su $user -c \"$execstr\"' if [ ! $test ] then output=`su $user -c "$execstr" 2>&1` @@ -249,11 +249,19 @@ fi do if [ $usevserver = yes ] then - execstr="$VSERVER $vsname exec $MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $ignore $db > $vroot$dumpdir/${db}.sql" + if [ "$compress" == "yes" ]; then + execstr="$VSERVER $vsname exec $MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $ignore $db | $GZIP > $vroot$dumpdir/${db}.sql.gz" + else + execstr="$VSERVER $vsname exec $MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $ignore $db > $vroot$dumpdir/${db}.sql" + fi else - execstr="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $ignore $db > $dumpdir/${db}.sql" + if [ "$compress" == "yes" ]; then + execstr="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $ignore $db | $GZIP > $dumpdir/${db}.sql.gz" + else + execstr="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $ignore $db > $dumpdir/${db}.sql" + fi fi - debug 'su $user -c "$execstr"' + debug "su $user -c \"$execstr\"" if [ ! $test ] then output=`su $user -c "$execstr" 2>&1` @@ -268,13 +276,6 @@ fi fi fi done - - if [ "$compress" == "yes" ] - then - output=`$GZIP -f $vroot$dumpdir/*.sql 2>&1` - debug $output - fi -fi # clean up tmp config file if [ "$dbusername" != "" -a "$dbpassword" != "" ]