mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

rsync-no-vanished (500B)


      1 #!/bin/bash
      2 
      3 # https://bugzilla.samba.org/show_bug.cgi?id=10356
      4 # support/rsync-no-vanished
      5 
      6 # also disable controlmaster to silence warnings
      7 
      8 
      9 IGNOREEXIT=24
     10 IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred|rsync: read errors mapping.*: No data available)'
     11 
     12 set -o pipefail
     13 
     14 rsync -e "ssh -o ControlPath=/nowhere -o ControlMaster=no" "${@}" 2>&1 | (egrep -v "$IGNOREOUT" || true)
     15 ret=$?
     16 
     17 if [[ $ret == $IGNOREEXIT ]]; then
     18     ret=0
     19 fi
     20 
     21 exit $ret
     22