Skip to content

Commit 9396a89

Browse files
authored
Merge pull request #467 from github/add-skip-checks-flg
add option for skipping checks
2 parents c960d8c + 4d3209d commit 9396a89

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
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 GHE_SKIP_CHECKS is set to true (or if --skip-checks is used with ghe-backup) then ghe-host-check
24+
# disk space validation and software version checks on the backup-host will be 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+
#/ --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+
--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: 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/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- **[GitHub Enterprise Server version requirements](requirements.md#github-enterprise-version-requirements)**
77
- **[Getting started](getting-started.md)**
88
- **[Using the backup and restore commands](usage.md)**
9-
- **[Scheduling backups](scheduling-backups.md)**
9+
- **[Scheduling backups & snapshot pruning](scheduling-backups.md)**
1010
- **[Backup snapshot file structure](backup-snapshot-file-structure.md)**
1111
- **[How does Backup Utilities differ from a High Availability replica?](faq.md)**
1212
- **[Docker](docker.md)**

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)