@@ -159,7 +159,7 @@ if [[ "$CALLING_SCRIPT" == "ghe-backup" ]]; then
159
159
# Display dir requirements for repositories and mysql
160
160
echo " Checking host for sufficient space for a backup..." 1>&2
161
161
available_space=$( df -B 1k $GHE_DATA_DIR | awk ' END{printf "%.0f", $4 * 1024}' )
162
- printf " Available space: %d MB. We recommend allocating at least 5x the amount of storage allocated to the primary GitHub appliance for historical snapshots and growth over time.\n " " $(( available_space / 1024 ** 2 )) " 1>&2
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
163
164
164
repos_disk_size=$( transfer_size repositories /tmp)
165
165
pages_disk_size=$( transfer_size pages /tmp)
@@ -170,17 +170,29 @@ if [[ "$CALLING_SCRIPT" == "ghe-backup" ]]; then
170
170
actions_disk_size=$( transfer_size actions /tmp)
171
171
mssql_disk_size=$( transfer_size mssql /tmp)
172
172
173
- # min_disk_req=$(( $(echo "$repos_disk_size" | awk '{printf "%.0f", $1}') + $(echo "$pages_disk_size" | awk '{printf "%.0f", $1}') + $(echo "$es_disk_size" | awk '{printf "%.0f", $1}') + $(echo "$stor_disk_size" | awk '{printf "%.0f", $1}') + $(echo "$minio_disk_size" | awk '{printf "%.0f", $1}') + $(echo "$mysql_disk_size" | awk '{printf "%.0f", $1/2}') + $(echo "$actions_disk_size" | awk '{printf "%.0f", $1}') + $(echo "$mssql_disk_size" | awk '{printf "%.0f", $1}') ))
174
- min_disk_req=$(( $(echo "$repos_disk_size ") + $(echo "$pages_disk_size ") + $(echo "$es_disk_size ") + $(echo "$stor_disk_size ") + $(echo "$minio_disk_size ") + $(echo "$mysql_disk_size ") + $(echo "$actions_disk_size ") + $(echo "$mssql_disk_size ") ))
175
- echo -e " ### Data Transfer Sizes \nrepositories: $repos_disk_size \npages: $pages_disk_size \nelasticsearch: $es_disk_size \nstorage: $stor_disk_size \nminio: $minio_disk_size \nmysql: $mysql_disk_size \nactions: $actions_disk_size \nmssql: $mssql_disk_size " 1>&2
176
- printf " min_disk_required for this backup is at least %d MB\n" " $(( min_disk_req / 1024 ** 2 )) " 1>&2
173
+ 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
176
+
177
+ cat << DATA_TRANSFER_SIZE 1>&2
178
+ ### 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
187
+ DATA_TRANSFER_SIZE
177
188
178
189
if [[ $available_space -lt $min_disk_req ]]; then
179
190
echo " There is not enough disk space for the backup. Please allocate more space and continue." 1>&2
180
191
exit 1
181
192
fi
182
193
183
194
# Check rsync, openssh & jq versions
195
+ echo " ### Software versions" 1>&2
184
196
rsync_version=$( rsync --version | grep ' version' | awk ' {print $3}' )
185
197
if awk " BEGIN {exit !($rsync_version < $min_rsync )}" & > /dev/null; then
186
198
echo " rsync version $rsync_version in backup-host does not meet minimum requirements." 1>&2
0 commit comments