]> arthur.barton.de Git - MkMySqlDump.git/blobdiff - bin/mkmysqldump
Show output of compression program to stdout, not stderr
[MkMySqlDump.git] / bin / mkmysqldump
index a470534b536c4bcfaee4afbf46affb051108741e..0dc345da357d5ec1b1b79e4804a43161fcedc67f 100755 (executable)
@@ -120,7 +120,7 @@ echo "Started: $(date)"
 
 umask 0077
 
-[ -n "$MYPW" ] && PWSWITCH="--password='$MYPW'" || PWSWITCH=""
+[ -n "$MYPW" ] && PWSWITCH="--password=$MYPW" || PWSWITCH=""
 
 echo "Getting list of databases from server ..."
 DATABASES=$(
@@ -138,7 +138,7 @@ fi
 
 echo "Checking slave status ..."
 Slave_IO_Running=""; Slave_SQL_Running=""
-eval "$(echo 'SHOW SLAVE STATUS\G' | mysql | sed -n '/Running/p' | sed 's/: /=/g')"
+eval "$(echo 'SHOW SLAVE STATUS\G' | mysql -h "$MYHOST" -u "$MYUSER" $PWSWITCH | sed -n '/Running/p' | sed 's/: /=/g')"
 if [ -n "$Slave_IO_Running" -o -n "$Slave_SQL_Running" ]; then
        if [ "$Slave_IO_Running" = "Yes" -a "$Slave_SQL_Running" = "Yes" ]; then
                echo "Server is running as MySQL slave, replication is Ok."
@@ -168,7 +168,8 @@ $CMD >"$OUTFILE"; r=$?
 if [ -n "$COMPRESS" -a -s "$OUTFILE" -a $r -eq 0 ]; then
        echo "Dump done: $(date)"
        echo "Compressing dump file ($COMPRESS) ..."
-       $COMPRESS "$OUTFILE"
+       $COMPRESS "$OUTFILE" 2>&1
+       [ $? -eq 0 ] || echo "Error compressing dump file!" >&2
 fi
 echo "End: $(date)"
 echo
@@ -185,10 +186,10 @@ fi
 
 if [ $r -eq 0 ]; then
        echo "Dump command exited with code 0, success."
+       echo
 else
        echo "Dump command FAILED with code $r!" >&2
        ErrorNotice
 fi
 
-echo
 exit $r