@@ -77,19 +77,6 @@ GHE_BACKUP_STRATEGY=$(cat "$GHE_RESTORE_SNAPSHOT_PATH/strategy")
7777# Perform a host-check and establish the remote version in GHE_REMOTE_VERSION.
7878ghe_remote_version_required " $GHE_HOSTNAME "
7979
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-
9380# Figure out if this instance has been configured or is entirely new.
9481instance_configured=false
9582if ghe-ssh " $GHE_HOSTNAME " -- \
167154echo " Starting restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT "
168155ghe_remote_logger " Starting restore from $( hostname) / snapshot $GHE_RESTORE_SNAPSHOT ..."
169156
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+
170175# Update remote restore state file and setup failure trap
171176trap " update_restore_status failed" EXIT
172177update_restore_status " restoring"
0 commit comments