summaryrefslogtreecommitdiff
path: root/rsync_tmbackup.sh
diff options
context:
space:
mode:
authorLaurent Cozic <laurent@cozic.net>2017-05-02 21:14:22 +0000
committerLaurent Cozic <laurent@cozic.net>2017-05-02 21:14:22 +0000
commit15329de6033f5fc054a10d41277ce6ed69925edc (patch)
tree16034102c8ef97908863e9ca28529483fde77203 /rsync_tmbackup.sh
parent77d8c56000e5028b31ee271d52f71a05d7dd60bf (diff)
Changed order of error/warning handling to avoid redundant error messages.
Displayed grep command that can be copied and pasted to investigate backup issues.
Diffstat (limited to 'rsync_tmbackup.sh')
-rwxr-xr-xrsync_tmbackup.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh
index fe589cc..24170b8 100755
--- a/rsync_tmbackup.sh
+++ b/rsync_tmbackup.sh
@@ -406,14 +406,15 @@ while : ; do
# Check whether rsync reported any errors
# -----------------------------------------------------------------------------
- if [ -n "$(grep "rsync:" "$LOG_FILE")" ]; then
- fn_log_warn "Rsync reported a warning, please check '$LOG_FILE' for more details."
- fi
if [ -n "$(grep "rsync error:" "$LOG_FILE")" ]; then
- fn_log_error "Rsync reported an error, please check '$LOG_FILE' for more details."
+ fn_log_error "Rsync reported an error. Run this command for more details: grep -E 'rsync:|rsync error:' '$LOG_FILE'"
exit 1
fi
+ if [ -n "$(grep "rsync:" "$LOG_FILE")" ]; then
+ fn_log_warn "Rsync reported a warning. Run this command for more details: grep -E 'rsync:|rsync error:' '$LOG_FILE'"
+ fi
+
# -----------------------------------------------------------------------------
# Add symlink to last successful backup
# -----------------------------------------------------------------------------