@@ -51,8 +51,8 @@ backup_current="$GHE_DATA_DIR/current/repositories"
5151
5252# Verify rsync is available.
5353if ! 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
5656fi
5757
5858# Perform a host-check and establish GHE_REMOTE_XXX variables.
@@ -108,28 +108,27 @@ done
108108# If we have a previous increment, avoid transferring existing files via rsync's
109109# --link-dest support. This also decreases physical space usage considerably.
110110if [ -d " $backup_current " ]; then
111- link_dest=" --link-dest=../../current/repositories"
111+ link_dest=" --link-dest=../../current/repositories"
112112fi
113113
114114# Transfer repository data from a GitHub instance to the current snapshot
115115# directory, using a previous snapshot to avoid transferring files that have
116116# already been transferred. A set of rsync filter rules are provided on stdin
117117# for each invocation.
118118rsync_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
130130}
131131
132-
133132for hostname in $hostnames ; do
134133 bm_start " $( basename $0 ) - $hostname "
135134 echo 1>&3
@@ -199,11 +198,11 @@ RULES
199198+ /*/nw/??/??/??/*/*.git/packed-refs
200199RULES
201200
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
207206- /__*__/
208207- /info/
209208
0 commit comments