Update github links.
[rsync.git] / support / rsync-no-vanished
blobb31a5d210fef8e4b3f052f56eb9258aea553f350
1 #!/usr/bin/env bash
3 REAL_RSYNC=/usr/bin/rsync
4 IGNOREEXIT=24
5 IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
7 # If someone installs this as "rsync", make sure we don't affect a server run.
8 for arg in "${@}"; do
9 if [[ "$arg" == --server ]]; then
10 exec $REAL_RSYNC "${@}"
11 exit $? # Not reached
13 done
15 set -o pipefail
17 # This filters stderr without merging it with stdout:
18 { $REAL_RSYNC "${@}" 2>&1 1>&3 3>&- | grep -E -v "$IGNOREOUT"; ret=${PIPESTATUS[0]}; } 3>&1 1>&2
20 if [[ $ret == $IGNOREEXIT ]]; then
21 ret=0
24 exit $ret