diff options
author | mail_redacted_for_web | 2020-04-03 16:48:59 +0200 |
---|---|---|
committer | mail_redacted_for_web | 2020-04-03 16:48:59 +0200 |
commit | e838de098a2de8fde719745bd23b2c198683c507 (patch) | |
tree | d8ad5e8f3ad0652e26be4a976f8e279359a48f5c | |
parent | 7f43bf9b203dbabae77704c1bae1c364b293c5a2 (diff) | |
download | rhel-scripts-e838de098a2de8fde719745bd23b2c198683c507.tar.bz2 |
Fixed outputs
-rwxr-xr-x | bin/sqlbackup | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/sqlbackup b/bin/sqlbackup index 69bbfbc..018d700 100755 --- a/bin/sqlbackup +++ b/bin/sqlbackup @@ -151,10 +151,10 @@ printf "File timestamp: %s\n" "$TIME" >> "$BLOG" mysql --user="$BUSER" --password="$(cat $PWFL)" -e "flush logs \\G" 2>> "$BLOG" if [ "$?" -ne 0 ];then [ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger err "flushing logs failed, check $BLOG" - [ "$SCHANAUZE" -ne 1 ]&&printf "$NEE\n\n" + [ "$SCHANAUZE" -ne 1 ]&&printf "%b\n\n" "$NEE" exit 101 else - [ "$SCHANAUZE" -ne 1 ]&&printf "$OGE\n\n" + [ "$SCHANAUZE" -ne 1 ]&&printf "%b\n\n" "$OGE" fi exit 0 LOGPOS="$(mysql --user="$BUSER" --password="$(cat $PWFL)" -e "show master status \G"|grep Position|awk '{print $NF}')" @@ -196,7 +196,7 @@ for i in "${DBARR[@]}";do fi if [ "$?" -ne 0 ];then [ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger err "backup of $i failed, check $BLOG" - [ "$SCHANAUZE" -ne 1 ]&&echo -e "$NEE" + [ "$SCHANAUZE" -ne 1 ]&&printf "%b\n" "$NEE" [ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger err "backup failed, check $BLOG" exit 2 fi @@ -204,7 +204,7 @@ for i in "${DBARR[@]}";do [ "$SCHANAUZE" -ne 1 ]&&printf ".. \033[u\033[K \033[1;30mcompression running...\033[0m" xz "$BDIR/$i-$TIME.sql"&&chmod 0600 "$BDIR/$i-$TIME.sql.xz" if [ "$?" -ne 0 ];then - [ "$SCHANAUZE" -ne 1 ]&&echo -e "$NEE" + [ "$SCHANAUZE" -ne 1 ]&&printf "%b\n" "$NEE" [ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger err "compression failed, check $BLOG" exit 3 fi @@ -215,9 +215,10 @@ done [ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger info "Purging binary logs..." mysql --user="$BUSER" --password="$(cat $PWFL)" -e "purge binary logs to \"$BINLOGF\" \\G" 2>> "$BLOG" if [ "$?" -ne 0 ];then - [ "$SCHANAUZE" -ne 1 ]&&echo -e "$NEE" + [ "$SCHANAUZE" -ne 1 ]&&printf "%b\n" "$NEE" [ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger err "purging of binary logs failed, check $BLOG" exit 3 fi sleep 0.1337 -echo -e "$OGE" +[ "$SCHANAUZE" -ne 1 ]&&printf "%b\n" "$OGE" +[ ! -z "$LOGGER" ]&&[ "$LOGGER" -eq 1 ]&&mlogger info "sqlbackup finished." |