File tree Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 48
48
# directory, using a previous snapshot to avoid transferring files that have
49
49
# already been transferred.
50
50
echo " * Performing initial sync of ES indices ..." 1>&3
51
- rsync -avz \
51
+ ghe- rsync -avz \
52
52
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
53
53
--rsync-path=' sudo -u git rsync' \
54
54
$link_dest \
@@ -73,7 +73,7 @@ ghe-ssh "$host" -- curl -s -XPOST "localhost:9200/_flush" >/dev/null
73
73
74
74
# Transfer all ES indices again
75
75
echo " * Performing follow-up sync of ES indices ..." 1>&3
76
- rsync -avz \
76
+ ghe- rsync -avz \
77
77
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
78
78
--rsync-path=' sudo -u git rsync' \
79
79
$link_dest \
Original file line number Diff line number Diff line change 32
32
# Transfer Pages data from a GitHub instance to the current snapshot
33
33
# directory, using a previous snapshot to avoid transferring files that have
34
34
# already been transferred.
35
- rsync -avz \
35
+ ghe- rsync -avz \
36
36
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
37
37
--rsync-path=' sudo -u git rsync' \
38
38
$link_dest \
Original file line number Diff line number Diff line change 92
92
# already been transferred. A set of rsync filter rules are provided on stdin
93
93
# for each invocation.
94
94
rsync_repository_data () {
95
- rsync -av \
95
+ ghe- rsync -av \
96
96
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
97
97
$link_dest " $@ " \
98
98
--rsync-path=' sudo -u git rsync' \
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ host="$1"
23
23
# Transfer all Pages data from the latest snapshot to the GitHub instance
24
24
# in a single rsync invocation.
25
25
if [ -d " $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /pages/" ]; then
26
- rsync -avz --delete \
26
+ ghe- rsync -avz --delete \
27
27
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
28
28
--rsync-path=" sudo -u git rsync" \
29
29
" $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /pages/" \
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ host="$1"
22
22
23
23
# Transfer all git repository data from the latest snapshot to the GitHub
24
24
# instance in a single rsync invocation.
25
- rsync -av --delete \
25
+ ghe- rsync -av --delete \
26
26
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
27
27
--rsync-path=" sudo -u git rsync" \
28
28
" $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /repositories/" \
Original file line number Diff line number Diff line change
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 both stdout (rsync versions < 3.x) and
11
+ # stderr (rsync versions >= 3.x). The complex redirections are necessary to
12
+ # filter stderr while also keeping stdout and stderr separated.
13
+ IGNOREOUT=' ^(file has vanished: |rsync warning: some files vanished before they could be transferred)'
14
+ (rsync " ${@ } " 3>&1 1>&2 2>&3 3>& - |
15
+ (egrep -v " $IGNOREOUT " || true)) 3>&1 1>&2 2>&3 3>& - |
16
+ (egrep -v " $IGNOREOUT " || true)
17
+ res=$?
18
+
19
+ # rsync exits with 24 when vanished files are detected.
20
+ if [ $res = 24 ]; then
21
+ res=0
22
+ fi
23
+
24
+ exit $res
You can’t perform that action at this time.
0 commit comments