@@ -49,38 +49,7 @@ export CALLING_SCRIPT="ghe-backup"
49
49
# shellcheck source=share/github-backup-utils/ghe-backup-config
50
50
. " $( dirname " ${BASH_SOURCE[0]} " ) /../share/github-backup-utils/ghe-backup-config"
51
51
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
76
52
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
84
53
# Check to make sure moreutils parallel is installed and working properly
85
54
ghe_parallel_check
86
55
@@ -187,9 +156,44 @@ log_info "Starting backup of $GHE_HOSTNAME with backup-utils v$BACKUP_UTILS_VERS
187
156
# Perform a host connection check and establish the remote appliance version.
188
157
# The version is available in the GHE_REMOTE_VERSION variable and also written
189
158
# 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.
190
161
ghe_remote_version_required
191
162
echo " $GHE_REMOTE_VERSION " > version
192
163
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
+
193
197
if [ -n " $GHE_ALLOW_REPLICA_BACKUP " ]; then
194
198
echo " Warning: backing up a high availability replica may result in inconsistent or unreliable backups."
195
199
fi
0 commit comments