We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent caa2b2b commit 82cddeeCopy full SHA for 82cddee
1 file changed
libexec/ghe-rsync
@@ -0,0 +1,22 @@
1
+#!/usr/bin/env bash
2
+#/ Usage: ghe-rsync
3
+#/ Run rsync with silenced vanished file warnings (non-critical).
4
+#
5
+# Based on the rsync-no-vanished support script included with rsync:
6
+# https://bugzilla.samba.org/show_bug.cgi?id=10356
7
+
8
+set -o pipefail
9
10
+# Filter vanished file warnings from stderr. The complex redirections are
11
+# necessary to filter stderr while also keeping stdout and stderr separated.
12
+IGNOREOUT='^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
13
+(rsync "${@}" 3>&1 1>&2 2>&3 3>&- |
14
+ (egrep -v "$IGNOREOUT" || true)) 3>&1 1>&2 2>&3 3>&-
15
+res=$?
16
17
+# rsync exits with 24 when vanished files are detected.
18
+if [ $res = 24 ]; then
19
+ res=0
20
+fi
21
22
+exit $res
0 commit comments