Still delete inprogress file in case of error or warning
This commit is contained in:
+10
-11
@@ -406,28 +406,27 @@ while : ; do
|
|||||||
# Check whether rsync reported any errors
|
# Check whether rsync reported any errors
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
EXIT_CODE="1"
|
||||||
if [ -n "$(grep "rsync error:" "$LOG_FILE")" ]; then
|
if [ -n "$(grep "rsync error:" "$LOG_FILE")" ]; then
|
||||||
fn_log_error "Rsync reported an error. Run this command for more details: grep -E 'rsync:|rsync error:' '$LOG_FILE'"
|
fn_log_error "Rsync reported an error. Run this command for more details: grep -E 'rsync:|rsync error:' '$LOG_FILE'"
|
||||||
exit 1
|
elif [ -n "$(grep "rsync:" "$LOG_FILE")" ]; then
|
||||||
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'"
|
fn_log_warn "Rsync reported a warning. Run this command for more details: grep -E 'rsync:|rsync error:' '$LOG_FILE'"
|
||||||
|
else
|
||||||
|
fn_log_info "Backup completed without errors."
|
||||||
|
if [[ $AUTO_DELETE_LOG == "1" ]]; then
|
||||||
|
rm -f -- "$LOG_FILE"
|
||||||
|
fi
|
||||||
|
EXIT_CODE="0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Add symlink to last successful backup
|
# Add symlink to last backup
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
fn_rm "$DEST_FOLDER/latest"
|
fn_rm "$DEST_FOLDER/latest"
|
||||||
fn_ln "$(basename -- "$DEST")" "$DEST_FOLDER/latest"
|
fn_ln "$(basename -- "$DEST")" "$DEST_FOLDER/latest"
|
||||||
|
|
||||||
fn_rm "$INPROGRESS_FILE"
|
fn_rm "$INPROGRESS_FILE"
|
||||||
if [[ $AUTO_DELETE_LOG == "1" ]]; then
|
|
||||||
rm -f -- "$LOG_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fn_log_info "Backup completed without errors."
|
exit $EXIT_CODE
|
||||||
|
|
||||||
exit 0
|
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user