Skip to content

Commit 3db1527

Browse files
authored
Merge pull request #477 from github/enterprise-3.9-backport-467-add-skip-checks-flg
Backport 467 for 3.9: add option for skipping checks
2 parents 8224f27 + cf3f87f commit 3db1527

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

backup.config-example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ GHE_DATA_DIR="data"
1616
# be available for the past N days ...
1717
GHE_NUM_SNAPSHOTS=10
1818

19+
# If GHE_SKIP_CHECKS is set to true (or if --skip-checks is used with ghe-backup) then ghe-host-check
20+
# disk space validation and software version checks on the backup-host will be disabled.
21+
#GHE_SKIP_CHECKS=false
22+
1923
# The hostname of the GitHub appliance to restore. If you've set up a separate
2024
# GitHub appliance to act as a standby for recovery, specify its IP or hostname
2125
# here. The host to restore to may also be specified directly when running

bin/ghe-backup

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
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+
#/ --skip-checks Skip storage/sw version checks
1112
#/
1213

1314
set -e
@@ -27,6 +28,10 @@ while true; do
2728
export GHE_VERBOSE=true
2829
shift
2930
;;
31+
--skip-checks)
32+
export GHE_SKIP_CHECKS=true
33+
shift
34+
;;
3035
-*)
3136
echo "Error: invalid argument: '$1'" 1>&2
3237
exit 1

bin/ghe-host-check

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,13 @@ 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 running ghe-backup with option "--skip-checks"
150+
OR updating GHE_SKIP_CHECKS to 'true' in your backup.config file.
151+
152+
SKIP_MSG
153+
148154
# Bring in the requirements file
149155
min_rsync=""
150156
min_openssh=""
@@ -184,6 +190,7 @@ minio: $minio_disk_size MB
184190
mysql: $mysql_disk_size MB
185191
actions: $actions_disk_size MB
186192
mssql: $mssql_disk_size MB
193+
187194
DATA_TRANSFER_SIZE
188195

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

docs/usage.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@ appliance at IP "5.5.5.5":
7373
Restore of 5.5.5.5:122 from snapshot 20180326T020444 finished.
7474
To complete the restore process, please visit https://5.5.5.5/setup/settings to review and save the appliance configuration.
7575

76-
A different backup snapshot may be selected by passing the `-s` argument and the
77-
datestamp-named directory from the backup location.
76+
A different backup snapshot may be selected by passing the `-s` argument to `ghe-restore` and specifying the
77+
datestamp-named directory from the backup location as the value.
7878

7979
The `ghe-backup` and `ghe-restore` commands also have a verbose output mode
8080
(`-v`) that lists files as they're being transferred. It's often useful to
8181
enable when output is logged to a file.
8282

83+
Every time you execute `ghe-backup` we verify the storage and software setup of the host
84+
you [installed][1] Backup Utilities on, to make sure our [requirements][2] for the host are
85+
met. You can disable this check using the `--skip-checks` argument or by
86+
adding `GHE_SKIP_CHECKS=true` to your configuration file.
87+
8388
### Restoring settings, TLS certificate, and license
8489

8590
When restoring to a new GitHub Enterprise Server instance, settings, certificate, and
@@ -107,3 +112,4 @@ GitHub Actions enabled, the following steps are required:
107112
Please refer to [GHES Documentation](https://docs.github.com/en/enterprise-server/admin/github-actions/advanced-configuration-and-troubleshooting/backing-up-and-restoring-github-enterprise-server-with-github-actions-enabled) for more details.
108113

109114
[1]: https://github.com/github/backup-utils/blob/master/docs/getting-started.md
115+
[2]: requirements.md

0 commit comments

Comments
 (0)