Skip to content

Commit dcfe6cc

Browse files
gamefiendchuckp22
andcommitted
Revising POC for testing
Co-authored-by: Chuck Pathanjali <[email protected]>
1 parent e44d516 commit dcfe6cc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

bin/ghe-backup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ trap 'exit $?' INT # ^C always terminate
122122
# Check to see if there is a running restore
123123
ghe_restore_check
124124

125+
# Check to see if there is a running backup
125126
if [ -h ../in-progress ]; then
126127
echo "Error: detected a backup already in progress from a previous version of ghe-backup." 1>&2
127128
echo "If there is no backup in progress anymore, please remove" 1>&2

bin/ghe-restore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ GHE_HOSTNAME="${GHE_RESTORE_HOST_OPT:-$GHE_RESTORE_HOST}"
164164
hostname=$(echo "$GHE_HOSTNAME" | cut -f 1 -d :)
165165

166166
# Show usage with no <host>
167-
#[ -z "$GHE_HOSTNAME" ] && print_usage
167+
[ -z "$GHE_HOSTNAME" ] && print_usage
168168

169169
# Flag to indicate if this script has stopped Actions.
170170
ACTIONS_STOPPED=false
@@ -175,11 +175,9 @@ GHE_RESTORE_SNAPSHOT_PATH="$(ghe-restore-snapshot-path "$snapshot_id")"
175175
GHE_RESTORE_SNAPSHOT=$(basename "$GHE_RESTORE_SNAPSHOT_PATH")
176176
export GHE_RESTORE_SNAPSHOT
177177

178+
ghe_backup_check
178179
ghe_restore_check
179-
ghe_restore_started $GHE_RESTORE_SNAPSHOT
180-
#ghe_restore_finished
181-
echo "This happened without any problems!"
182-
exit 1
180+
183181
# Detect if the backup we are restoring has a leaked ssh key
184182
echo "Checking for leaked keys in the backup snapshot that is being restored ..."
185183
ghe-detect-leaked-ssh-keys -s "$GHE_RESTORE_SNAPSHOT_PATH" || true
@@ -262,6 +260,7 @@ START_TIME=$(date +%s)
262260
echo 'Start time:' $START_TIME
263261
echo "Starting restore of $GHE_HOSTNAME with backup-utils v$BACKUP_UTILS_VERSION from snapshot $GHE_RESTORE_SNAPSHOT"
264262
ghe_remote_logger "Starting restore from $(hostname) with backup-utils v$BACKUP_UTILS_VERSION / snapshot $GHE_RESTORE_SNAPSHOT ..."
263+
ghe_restore_started $START_TIME
265264

266265
# Keep other processes on the VM or cluster in the loop about the restore status.
267266
#
@@ -589,6 +588,7 @@ echo 'End time:' $END_TIME
589588
echo 'Runtime:' $(($END_TIME - $START_TIME)) 'seconds'
590589

591590
echo "Restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT finished."
591+
ghe_restore_finished
592592

593593
if ! $instance_configured; then
594594
echo "To complete the restore process, please visit https://$hostname/setup/settings to review and save the appliance configuration."

0 commit comments

Comments
 (0)