Skip to content

Commit c64f6fc

Browse files
committed
add option for skipping checks
1 parent 56529f9 commit c64f6fc

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

backup.config-example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ GHE_NUM_SNAPSHOTS=10
2020
# ghe-pruning-snapshots will need to be invoked separately via cron
2121
#GHE_PRUNING_SCHEDULED=yes
2222

23+
# If set to true or when backup is run with `-s` or `--skip-checks` ghe-host-check
24+
# disk space validation is disabled.
25+
# GHE_SKIP_CHECKS=false
26+
2327
# The hostname of the GitHub appliance to restore. If you've set up a separate
2428
# GitHub appliance to act as a standby for recovery, specify its IP or hostname
2529
# here. The host to restore to may also be specified directly when running

bin/ghe-backup

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
#/ the MySQL database, instance settings, GitHub Pages data, etc.
66
#/
77
#/ OPTIONS:
8-
#/ -v | --verbose Enable verbose output.
9-
#/ -h | --help Show this message.
10-
#/ --version Display version information.
8+
#/ -v | --verbose Enable verbose output.
9+
#/ -h | --help Show this message.
10+
#/ --version Display version information.
11+
#/ -i | --incremental Incremental backup
12+
#/ -s | --skip-checks Skip storage/sw version checks
1113
#/
1214

1315
set -e
@@ -31,6 +33,10 @@ while true; do
3133
export GHE_INCREMENTAL=true
3234
shift
3335
;;
36+
-s|--skip-checks)
37+
export GHE_SKIP_CHECKS=true
38+
shift
39+
;;
3440
-*)
3541
echo "Error: invalid argument: '$1'" 1>&2
3642
exit 1

bin/ghe-host-check

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,12 @@ if [ -z "$supported" ]; then
144144
exit 1
145145
fi
146146

147-
if [[ "$CALLING_SCRIPT" == "ghe-backup" ]]; then
147+
if [[ "$CALLING_SCRIPT" == "ghe-backup" && "$GHE_SKIP_CHECKS" != "true" ]]; then
148+
cat << SKIP_MSG 1>&2
149+
**You can disable the following storage & version checks by updating GHE_SKIP_CHECKS to 'true' in your backup.config file.
150+
151+
SKIP_MSG
152+
148153
# Bring in the requirements file
149154
min_rsync=""
150155
min_openssh=""
@@ -184,6 +189,7 @@ minio: $minio_disk_size MB
184189
mysql: $mysql_disk_size MB
185190
actions: $actions_disk_size MB
186191
mssql: $mssql_disk_size MB
192+
187193
DATA_TRANSFER_SIZE
188194

189195
if [[ $((available_space / (1024 * 1024))) -lt $min_disk_req ]]; then

0 commit comments

Comments
 (0)