diff options
author | intrigeri <intrigeri@boum.org> | 2012-06-29 22:41:42 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2012-06-29 22:41:42 +0200 |
commit | 9e46615b3ed93a3dd0e65eaddac1a41a336ab3af (patch) | |
tree | 5915cdc97dd70ec85d6e27e8169c55240f744e4e /handlers/rsync.in | |
parent | 803cca309c9dad189331b834ecbb28c14d4a6452 (diff) | |
parent | 371b86d1be5c81febffd3d9f733089bacf43c0dc (diff) | |
download | backupninja-9e46615b3ed93a3dd0e65eaddac1a41a336ab3af.tar.gz backupninja-9e46615b3ed93a3dd0e65eaddac1a41a336ab3af.tar.bz2 |
Merge tag 'backupninja_upstream/1.0.1' into debian
Upstream version 1.0.1
Diffstat (limited to 'handlers/rsync.in')
-rw-r--r-- | handlers/rsync.in | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in index f0df52f..1954fc1 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -1096,6 +1096,26 @@ function restore_pipefail { } +function check_rsync_exit_status { + + if [ -z "$1" ]; then + return + fi + + case $1 in + 0) + return + ;; + 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 +1140,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 |