From fdf96ef734d55a947b8363d01fbe6d354bc65d8e Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 10 Jul 2020 09:28:38 -0400 Subject: [PATCH] fix bug in syncHttpLogs causing them to fail --- roles/base/files/syncHttpLogs.sh | 1 + roles/base/templates/syncHttpLogs.sh.j2 | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/base/files/syncHttpLogs.sh b/roles/base/files/syncHttpLogs.sh index 600a6814da..cafdede795 100644 --- a/roles/base/files/syncHttpLogs.sh +++ b/roles/base/files/syncHttpLogs.sh @@ -26,6 +26,7 @@ function syncHttpLogs { /usr/bin/rsync $RSYNC_FLAGS $HOST::log/httpd/$f ./$DEST &> /dev/null if [[ $? -ne 0 ]]; then echo "rsync from $HOST for file $f failed" + fi done done } diff --git a/roles/base/templates/syncHttpLogs.sh.j2 b/roles/base/templates/syncHttpLogs.sh.j2 index bf9bae84f4..0735436875 100644 --- a/roles/base/templates/syncHttpLogs.sh.j2 +++ b/roles/base/templates/syncHttpLogs.sh.j2 @@ -23,7 +23,10 @@ function syncHttpLogs { for f in $(/usr/bin/rsync $RSYNC_FLAGS --list-only $HOST::log/httpd/*$YESTERDAY* | awk '{ print $5 }') do DEST=$(echo $f | /bin/sed s/-$YESTERDAY//) - /usr/bin/rsync $RSYNC_FLAGS $HOST::log/httpd/$f ./$DEST + /usr/bin/rsync $RSYNC_FLAGS $HOST::log/httpd/$f ./$DEST &> /dev/null + if [[ $? -ne 0 ]]; then + echo "rsync from $HOST for file $f failed" + fi done done }