Skip to content

Commit 09bd75b

Browse files
Merge branch 'master' into suppress-secret-scanning-encrypted-secrets-warning
2 parents 8bd786e + 1d88f9d commit 09bd75b

File tree

2 files changed

+36
-32
lines changed

2 files changed

+36
-32
lines changed

bin/ghe-backup

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,7 @@ export CALLING_SCRIPT="ghe-backup"
5454
# shellcheck source=share/github-backup-utils/ghe-backup-config
5555
. "$( dirname "${BASH_SOURCE[0]}" )/../share/github-backup-utils/ghe-backup-config"
5656

57-
# Setup progress tracking
58-
init-progress
59-
export PROGRESS_TOTAL=14 # Minimum number of steps in backup is 14
60-
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
61-
export PROGRESS_TYPE="Backup"
62-
echo "$PROGRESS_TYPE" > /tmp/backup-utils-progress-type
63-
export PROGRESS=0 # Used to track progress of backup
64-
echo "$PROGRESS" > /tmp/backup-utils-progress
65-
66-
OPTIONAL_STEPS=0
67-
# Backup actions+mssql
68-
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.actions.enabled'; then
69-
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 2))
70-
fi
71-
72-
# Backup fsck
73-
if [ "$GHE_BACKUP_FSCK" = "yes" ]; then
74-
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
75-
fi
76-
77-
# Backup minio
78-
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.minio.enabled'; then
79-
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
80-
fi
8157

82-
# Backup pages
83-
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
84-
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
85-
fi
86-
87-
PROGRESS_TOTAL=$((OPTIONAL_STEPS + PROGRESS_TOTAL)) # Minimum number of steps in backup is 14
88-
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
8958
# Check to make sure moreutils parallel is installed and working properly
9059
ghe_parallel_check
9160

@@ -186,9 +155,44 @@ fi
186155
# Perform a host connection check and establish the remote appliance version.
187156
# The version is available in the GHE_REMOTE_VERSION variable and also written
188157
# to a version file in the snapshot directory itself.
158+
# ghe_remote_version_required should be run before any other instances of ghe-ssh
159+
# to ensure that there are no problems with host key verification.
189160
ghe_remote_version_required
190161
echo "$GHE_REMOTE_VERSION" > version
191162

163+
# Setup progress tracking
164+
init-progress
165+
export PROGRESS_TOTAL=14 # Minimum number of steps in backup is 14
166+
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
167+
export PROGRESS_TYPE="Backup"
168+
echo "$PROGRESS_TYPE" > /tmp/backup-utils-progress-type
169+
export PROGRESS=0 # Used to track progress of backup
170+
echo "$PROGRESS" > /tmp/backup-utils-progress
171+
172+
OPTIONAL_STEPS=0
173+
# Backup actions+mssql
174+
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.actions.enabled'; then
175+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 2))
176+
fi
177+
178+
# Backup fsck
179+
if [ "$GHE_BACKUP_FSCK" = "yes" ]; then
180+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
181+
fi
182+
183+
# Backup minio
184+
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.minio.enabled'; then
185+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
186+
fi
187+
188+
# Backup pages
189+
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
190+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
191+
fi
192+
193+
PROGRESS_TOTAL=$((OPTIONAL_STEPS + PROGRESS_TOTAL)) # Minimum number of steps in backup is 14
194+
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
195+
192196
# check that incremental settings are valid if set
193197
is_inc=$(is_incremental_backup_feature_on)
194198

docs/requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ storage and must have network connectivity with the GitHub Enterprise Server app
55

66
## Backup host requirements
77

8-
Backup host software requirements are modest: Linux or other modern Unix operating system (Ubuntu is highly recommended) with [bash][1], [git][2], [OpenSSH][3] 5.6 or newer, [rsync][4] v2.6.4 or newer* (see [below](april-2023-update-of-rsync-requirements) for exceptions), [jq][11] v1.5 or newer, and [bc][12] v1.07 or newer.
8+
Backup host software requirements are modest: Linux or other modern Unix operating system (Ubuntu is highly recommended) with [bash][1], [git][2], [OpenSSH][3] 5.6 or newer, [rsync][4] v2.6.4 or newer* (see [below](#april-2023-update-of-rsync-requirements) for exceptions), [jq][11] v1.5 or newer, and [bc][12] v1.07 or newer.
99

1010
The parallel backup and restore feature will require [GNU awk][10] and [moreutils][9] to be installed.
1111

0 commit comments

Comments
 (0)