@@ -77,19 +77,6 @@ GHE_BACKUP_STRATEGY=$(cat "$GHE_RESTORE_SNAPSHOT_PATH/strategy")
77
77
# Perform a host-check and establish the remote version in GHE_REMOTE_VERSION.
78
78
ghe_remote_version_required " $GHE_HOSTNAME "
79
79
80
- # Keep other processes on the VM in the loop about the restore status.
81
- #
82
- # Other processes will look for these states:
83
- # "restoring" - restore is currently in progress
84
- # "failed" - restore has failed
85
- # "complete" - restore has completed successfully
86
- update_restore_status () {
87
- if [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
88
- echo " $1 " |
89
- ghe-ssh " $GHE_HOSTNAME " -- " sudo dd of='$GHE_REMOTE_DATA_USER_DIR /common/ghe-restore-status' 2>/dev/null"
90
- fi
91
- }
92
-
93
80
# Figure out if this instance has been configured or is entirely new.
94
81
instance_configured=false
95
82
if ghe-ssh " $GHE_HOSTNAME " -- \
167
154
echo " Starting restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT "
168
155
ghe_remote_logger " Starting restore from $( hostname) / snapshot $GHE_RESTORE_SNAPSHOT ..."
169
156
157
+ # Keep other processes on the VM or cluster in the loop about the restore status.
158
+ #
159
+ # Other processes will look for these states:
160
+ # "restoring" - restore is currently in progress
161
+ # "failed" - restore has failed
162
+ # "complete" - restore has completed successfully
163
+ update_restore_status () {
164
+ if [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
165
+ if $cluster ; then
166
+ echo " ghe-cluster-each -- \" echo '$1 ' | sudo dd of='$GHE_REMOTE_DATA_USER_DIR /common/ghe-restore-status' >/dev/null\" " |
167
+ ghe-ssh " $GHE_HOSTNAME " /bin/bash
168
+ else
169
+ echo " $1 " |
170
+ ghe-ssh " $GHE_HOSTNAME " -- " sudo dd of='$GHE_REMOTE_DATA_USER_DIR /common/ghe-restore-status' >/dev/null"
171
+ fi
172
+ fi
173
+ }
174
+
170
175
# Update remote restore state file and setup failure trap
171
176
trap " update_restore_status failed" EXIT
172
177
update_restore_status " restoring"
0 commit comments