@@ -157,9 +157,10 @@ if [[ "$CALLING_SCRIPT" == "ghe-backup" ]]; then
157
157
. " $( dirname " ${BASH_SOURCE[0]} " ) /../share/github-backup-utils/ghe-rsync-size"
158
158
159
159
# Display dir requirements for repositories and mysql
160
+ echo " " 1>&2
160
161
echo " Checking host for sufficient space for a backup..." 1>&2
161
162
available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
162
- echo " We recommend allocating at least 5x the amount of storage allocated to the primary GitHub appliance for historical snapshots and growth over time." 1>&2
163
+ echo " We recommend allocating at least 5x the amount of storage allocated to the primary GitHub appliance for historical snapshots and growth over time." 1>&2
163
164
164
165
repos_disk_size=$( transfer_size repositories /tmp)
165
166
pages_disk_size=$( transfer_size pages /tmp)
@@ -171,20 +172,24 @@ if [[ "$CALLING_SCRIPT" == "ghe-backup" ]]; then
171
172
mssql_disk_size=$( transfer_size mssql /tmp)
172
173
173
174
min_disk_req=$(( repos_disk_size + pages_disk_size + es_disk_size + stor_disk_size + minio_disk_size + mysql_disk_size + actions_disk_size + mssql_disk_size))
174
- echo " Available space: $(( available_space / (1024 ** 2 )) ) MB" 1>&2
175
- echo -e " Min Disk required for this backup is at least $min_disk_req MB\n" 1>&2
175
+ recommended_disk_req=$(( min_disk_req * 5 ))
176
+ echo " - Available space: $(( available_space / (1024 ** 2 )) ) MB" 1>&2
177
+ echo " - Min Disk required for this backup is at least $min_disk_req MB" 1>&2
178
+ echo " - Recommended Disk requirement is $recommended_disk_req MB" 1>&2
179
+ echo " " 1>&2
176
180
177
- cat << DATA_TRANSFER_SIZE 1>&2
181
+ cat << DATA_TRANSFER_SIZE 1>&2
178
182
### Data Transfer Sizes
179
- repositories: $repos_disk_size MB
180
- pages: $pages_disk_size MB
181
- elasticsearch: $es_disk_size MB
182
- storage: $stor_disk_size MB
183
- minio: $minio_disk_size MB
184
- mysql: $mysql_disk_size MB
185
- actions: $actions_disk_size MB
186
- mssql: $mssql_disk_size MB
183
+ - repositories: $repos_disk_size MB
184
+ - pages: $pages_disk_size MB
185
+ - elasticsearch: $es_disk_size MB
186
+ - storage: $stor_disk_size MB
187
+ - minio: $minio_disk_size MB
188
+ - mysql: $mysql_disk_size MB
189
+ - actions: $actions_disk_size MB
190
+ - mssql: $mssql_disk_size MB
187
191
DATA_TRANSFER_SIZE
192
+ echo " " 1>&2
188
193
189
194
if [[ $(( available_space / (1024 * 1024 )) ) -lt $min_disk_req ]]; then
190
195
echo " There is not enough disk space for the backup. Please allocate more space and continue." 1>&2
@@ -223,15 +228,15 @@ You can disable this warning by changing RSYNC_WARNING to 'no' in your backup.co
223
228
224
229
WARN_MSG
225
230
fi
226
- echo " rsync ${rsync_version} >= required ($min_rsync )" 1>&2
231
+ echo " - rsync ${rsync_version} >= required ($min_rsync )" 1>&2
227
232
228
233
ssh_version=$( ssh -V 2>&1 | awk ' {print $1}' | grep -oPm 1 ' [\d\.]+' | head -1 | tr -cd ' [:digit:].\n' )
229
234
if awk " BEGIN {exit !($ssh_version < $min_openssh )}" & > /dev/null; then
230
235
echo " openSSH version $ssh_version in backup-host does not meet minimum requirements." 1>&2
231
236
echo " Please make sure the minimum required version of openSSH: $min_openssh is installed" 1>&2
232
237
exit 1
233
238
else
234
- echo " openSSH ${ssh_version} >= required ($min_openssh )" 1>&2
239
+ echo " - openSSH ${ssh_version} >= required ($min_openssh )" 1>&2
235
240
fi
236
241
237
242
jq_version=$( jq --version | awk -F\- ' {print $2}' | tr -cd ' [:digit:].\n' )
@@ -240,8 +245,8 @@ WARN_MSG
240
245
echo " Please make sure you have the minimum required version of jq: $min_jq installed" 1>&2
241
246
exit 1
242
247
else
243
- echo " jq ${jq_version} >= required ($min_jq )" 1>&2
248
+ echo " - jq ${jq_version} >= required ($min_jq )" 1>&2
244
249
fi
245
250
fi
246
-
251
+ echo " " 1>&2
247
252
echo " Connect $hostname :$port OK (v$version )"
0 commit comments