@@ -85,33 +85,28 @@ if [ $rc -ne 0 ]; then
8585 exit $rc
8686fi
8787
88- if [ -z " $CLUSTER " ]; then
89- CLUSTER=false
90- fi
88+ CLUSTER=false
9189if ghe-ssh " $host " -- \
9290 " [ -f '$GHE_REMOTE_ROOT_DIR /etc/github/cluster' ]" ; then
9391 CLUSTER=true
9492fi
9593
96- set +e
9794# ensure all nodes in the cluster are online/reachable and running the same version
9895if " $CLUSTER " ; then
9996 online_status=$( ghe-ssh " $host " ghe-cluster-host-check)
10097 if [ " $online_status " != " Cluster is ready to configure." ]; then
101- echo " $online_status " 1>&2
102- log_error " Error: Not all nodes are online! Please ensure cluster is in a healthy state before using backup-utils." 1>&2
98+ echo " Error: Not all nodes are online! Please ensure cluster is in a healthy state before using backup-utils." 1>&2
10399 exit 1
104100 fi
105101
106102 node_version_list=$( ghe-ssh " $host " ghe-cluster-each -- ghe-version)
107103 distinct_versions=$( echo " $node_version_list " | awk ' {split($0, a, ":"); print a[2]}' | awk ' {print $4}' | uniq | wc -l)
108104 if [ " $distinct_versions " -ne 1 ]; then
109105 echo " Version mismatch: $node_version_list " 1>&2
110- log_error " Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils." 1>&2
106+ echo " Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils." 1>&2
111107 exit 1
112108 fi
113109fi
114- set -e
115110
116111version=$( echo " $output " | grep " GitHub Enterprise" | awk ' {print $NF}' )
117112
@@ -120,37 +115,6 @@ if [ -z "$version" ]; then
120115 exit 2
121116fi
122117
123- NON_WRITABLE=" "
124- # ensure all nodes are writable
125- if [ " $CLUSTER " == " true" ] ; then
126- if [ -z " $GHE_FILE_SYSTEM_WRITE_CHECK " ]; then
127- if [ -d " /data/user/tmp" ]; then
128- WRITE_CHECK_FILE=" /data/user/tmp/test-ro-file.txt"
129- else
130- WRITE_CHECK_FILE=" /tmp/test-ro-file.txt"
131- fi
132- else
133- WRITE_CHECK_FILE=" $GHE_FILE_SYSTEM_CHECK /test-ro-file.txt"
134- fi
135-
136- # Iterate through each node in the cluster
137- nodes=$( ghe-ssh " $host " ghe-cluster-nodes)
138- for node in $nodes ; do
139- if ! echo " set -o pipefail; ssh $node -- 'touch $WRITE_CHECK_FILE && rm $WRITE_CHECK_FILE '" | ghe-ssh " $host " /bin/bash; then
140- echo " File system is not writeable or no permission on $node " 1>&2
141- NON_WRITABLE+=" $node "
142- fi || true
143- done
144- # Display the comma-separated list of non-writable nodes
145- if [ -n " $NON_WRITABLE " ]; then
146- NON_WRITABLE=$( echo " $NON_WRITABLE " | sed ' s/ /, /g; s/, $//' )
147- log_error " Error: Following nodes are non-writable - $NON_WRITABLE . Please make sure the filesystem for all GHES nodes are writable." 1>&2
148- exit 1
149- else
150- log_info " All nodes are writable."
151- fi
152- fi
153-
154118# Block restoring snapshots to older releases of GitHub Enterprise Server
155119if [ -n " $GHE_RESTORE_SNAPSHOT_PATH " ]; then
156120 snapshot_version=$( cat $GHE_RESTORE_SNAPSHOT_PATH /version)
@@ -213,7 +177,7 @@ SKIP_MSG
213177
214178 # Display dir requirements for repositories and mysql
215179 echo -e " \nChecking host for sufficient space for a backup..."
216- available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
180+ available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
217181 echo " We recommend allocating at least 5x the amount of storage allocated to the primary GitHub appliance for historical snapshots and growth over time."
218182
219183 repos_disk_size=$( transfer_size repositories /tmp)
0 commit comments