Skip to content

Commit ab37cfc

Browse files
committed
Merge remote-tracking branch 'private/enterprise-3.9-release' into 3.9.2-patch
2 parents a5ac99d + 09f39cf commit ab37cfc

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
@@ -49,38 +49,7 @@ export CALLING_SCRIPT="ghe-backup"
4949
# shellcheck source=share/github-backup-utils/ghe-backup-config
5050
. "$( dirname "${BASH_SOURCE[0]}" )/../share/github-backup-utils/ghe-backup-config"
5151

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

77-
# Backup pages
78-
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
79-
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
80-
fi
81-
82-
PROGRESS_TOTAL=$((OPTIONAL_STEPS + PROGRESS_TOTAL)) # Minimum number of steps in backup is 14
83-
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
8453
# Check to make sure moreutils parallel is installed and working properly
8554
ghe_parallel_check
8655

@@ -187,9 +156,44 @@ log_info "Starting backup of $GHE_HOSTNAME with backup-utils v$BACKUP_UTILS_VERS
187156
# Perform a host connection check and establish the remote appliance version.
188157
# The version is available in the GHE_REMOTE_VERSION variable and also written
189158
# to a version file in the snapshot directory itself.
159+
# ghe_remote_version_required should be run before any other instances of ghe-ssh
160+
# to ensure that there are no problems with host key verification.
190161
ghe_remote_version_required
191162
echo "$GHE_REMOTE_VERSION" > version
192163

164+
# Setup progress tracking
165+
init-progress
166+
export PROGRESS_TOTAL=14 # Minimum number of steps in backup is 14
167+
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
168+
export PROGRESS_TYPE="Backup"
169+
echo "$PROGRESS_TYPE" > /tmp/backup-utils-progress-type
170+
export PROGRESS=0 # Used to track progress of backup
171+
echo "$PROGRESS" > /tmp/backup-utils-progress
172+
173+
OPTIONAL_STEPS=0
174+
# Backup actions+mssql
175+
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.actions.enabled'; then
176+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 2))
177+
fi
178+
179+
# Backup fsck
180+
if [ "$GHE_BACKUP_FSCK" = "yes" ]; then
181+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
182+
fi
183+
184+
# Backup minio
185+
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.minio.enabled'; then
186+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
187+
fi
188+
189+
# Backup pages
190+
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
191+
OPTIONAL_STEPS=$((OPTIONAL_STEPS + 1))
192+
fi
193+
194+
PROGRESS_TOTAL=$((OPTIONAL_STEPS + PROGRESS_TOTAL)) # Minimum number of steps in backup is 14
195+
echo "$PROGRESS_TOTAL" > /tmp/backup-utils-progress-total
196+
193197
if [ -n "$GHE_ALLOW_REPLICA_BACKUP" ]; then
194198
echo "Warning: backing up a high availability replica may result in inconsistent or unreliable backups."
195199
fi

0 commit comments

Comments
 (0)