From b8e78c656a4085d61899609d958341167dfbf81c Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 22 Oct 2017 18:37:39 +0200 Subject: [PATCH] Show output of compression program to stdout, not stderr Some compression programs show their status output on stderr [xz(1), for example], so redirect to stdout and display an extra error message when the compression program exited "non zero". This enhances the user experience when using some "mail wrapper" scripts etc. --- bin/mkmysqldump | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/mkmysqldump b/bin/mkmysqldump index 87f9db2..0dc345d 100755 --- a/bin/mkmysqldump +++ b/bin/mkmysqldump @@ -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 -- 2.39.2