Skip to content

Commit 8079fe3

Browse files
authored
Merge pull request #514 from github/enterprise-3.10-backport-513-host-key-fix
Backport 513 for 3.10: Host key fix
2 parents 2fd918e + 703b899 commit 8079fe3

File tree

1 file changed

+35
-31
lines changed

1 file changed

+35
-31
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

0 commit comments

Comments
 (0)