aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-06-20 00:38:23 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-06-20 00:38:23 -0300
commit05f596080dc119cbb3b5c8fdf28be4f8e30d3118 (patch)
treebada7ba262ce206d0d3556d781e7d1c372e69d53
parentaae966981e259b11afc1e01b68d4fa7c59cde646 (diff)
downloadbackupninja-05f596080dc119cbb3b5c8fdf28be4f8e30d3118.tar.gz
backupninja-05f596080dc119cbb3b5c8fdf28be4f8e30d3118.tar.bz2
Issue just warnings on non-fatal rsync errors (#3966)bug/3966
-rw-r--r--handlers/rsync.in22
1 files changed, 18 insertions, 4 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in
index f0df52f..e0d2b1f 100644
--- a/handlers/rsync.in
+++ b/handlers/rsync.in
@@ -1096,6 +1096,23 @@ function restore_pipefail {
}
+function check_rsync_exit_status {
+
+ if [ -z "$1" ]; then
+ return
+ fi
+
+ case $1 in
+ 1|2|3|4|5|6|10|11|12|13|14|21)
+ fatal "Rsync error $1 when trying to transfer $SECTION"
+ ;;
+ *)
+ warning "Rsync error $1 when trying to transfer $SECTION"
+ ;;
+ esac
+
+}
+
# the backup procedure
eval_config
@@ -1120,10 +1137,7 @@ for SECTION in $include; do
set_pipefail
$nice su -c "$rsync ${rsync_options[@]} --delete-excluded $filelist_flag $excludes $batch_option $orig $dest_path" | tee -a $log
- if [ "$?" != "0" ]; then
- fatal "Rsync error when trying to transfer $SECTION"
- fi
-
+ check_rsync_exit_status $?
restore_pipefail
update_metadata