@@ -51,8 +51,8 @@ backup_current="$GHE_DATA_DIR/current/repositories"
51
51
52
52
# Verify rsync is available.
53
53
if ! rsync --version 1> /dev/null 2>&1 ; then
54
- echo " Error: rsync not found." 1>&2
55
- exit 1
54
+ echo " Error: rsync not found." 1>&2
55
+ exit 1
56
56
fi
57
57
58
58
# Perform a host-check and establish GHE_REMOTE_XXX variables.
@@ -108,28 +108,27 @@ done
108
108
# If we have a previous increment, avoid transferring existing files via rsync's
109
109
# --link-dest support. This also decreases physical space usage considerably.
110
110
if [ -d " $backup_current " ]; then
111
- link_dest=" --link-dest=../../current/repositories"
111
+ link_dest=" --link-dest=../../current/repositories"
112
112
fi
113
113
114
114
# Transfer repository data from a GitHub instance to the current snapshot
115
115
# directory, using a previous snapshot to avoid transferring files that have
116
116
# already been transferred. A set of rsync filter rules are provided on stdin
117
117
# for each invocation.
118
118
rsync_repository_data () {
119
- port=$( ssh_port_part " $1 " )
120
- host=$( ssh_host_part " $1 " )
121
-
122
- shift
123
- ghe-rsync -av \
124
- -e " ssh -q $opts -p $port -F $config_file -l $user " \
125
- $link_dest " $@ " \
126
- --rsync-path=' sudo -u git rsync' \
127
- --include-from=- --exclude=\* \
128
- " $host :$GHE_REMOTE_DATA_USER_DIR /repositories/" \
129
- " $backup_dir " 1>&3
119
+ port=$( ssh_port_part " $1 " )
120
+ host=$( ssh_host_part " $1 " )
121
+
122
+ shift
123
+ ghe-rsync -av \
124
+ -e " ssh -q $opts -p $port -F $config_file -l $user " \
125
+ $link_dest " $@ " \
126
+ --rsync-path=' sudo -u git rsync' \
127
+ --include-from=- --exclude=\* \
128
+ " $host :$GHE_REMOTE_DATA_USER_DIR /repositories/" \
129
+ " $backup_dir " 1>&3
130
130
}
131
131
132
-
133
132
for hostname in $hostnames ; do
134
133
bm_start " $( basename $0 ) - $hostname "
135
134
echo 1>&3
@@ -199,11 +198,11 @@ RULES
199
198
+ /*/nw/??/??/??/*/*.git/packed-refs
200
199
RULES
201
200
202
- # Sync loose refs and reflogs. This must be performed before object data is
203
- # transferred to ensure that all referenced objects are included.
204
- echo 1>&3
205
- echo " * Transferring refs and reflogs ..." 1>&3
206
- rsync_repository_data $hostname :122 -z << RULES
201
+ # Sync loose refs and reflogs. This must be performed before object data is
202
+ # transferred to ensure that all referenced objects are included.
203
+ echo 1>&3
204
+ echo " * Transferring refs and reflogs ..." 1>&3
205
+ rsync_repository_data $hostname :122 -z << RULES
207
206
- /__*__/
208
207
- /info/
209
208
0 commit comments