Skip to content

Commit 2ab98ba

Browse files
committed
Fixing issues with parallel operations
1 parent 716aa49 commit 2ab98ba

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

bin/ghe-restore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,7 @@ fi
505505
cmd_title=$(log_info "Restoring Redis database ...")
506506
commands=("
507507
echo \"$cmd_title\"
508-
bm_start \"$(basename $0) - Restoring Redis\"
509-
ghe-ssh \"$GHE_HOSTNAME\" -- 'ghe-import-redis' < \"$GHE_RESTORE_SNAPSHOT_PATH/redis.rdb\" 1>&3
510-
bm_end \"$(basename $0) - Restoring Redis\"")
508+
ghe-restore-redis \"$GHE_HOSTNAME\")
511509
512510
cmd_title=$(log_info "Restoring Git Repositories ...")
513511
commands+=("
@@ -527,9 +525,7 @@ ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
527525
cmd_title=$(log_info "Restoring SSH authorized keys ...")
528526
commands+=("
529527
echo \"$cmd_title\"
530-
bm_start \"$(basename $0) -Restoring SSH authorized keys\"
531-
ghe-ssh \"$GHE_HOSTNAME\" -- 'ghe-import-authorized-keys' < \"$GHE_RESTORE_SNAPSHOT_PATH/authorized-keys.json\" 1>&3
532-
bm_end \"$(basename $0) -Restoring SSH authorized keys\"")
528+
ghe-restore-ssh-keys \"$GHE_HOSTNAME\" \"$GHE_RESTORE_SNAPSHOT_PATH\")
533529

534530
cmd_title=$(log_info "Restoring storage data ...")
535531
commands+=("
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#/ Usage: ghe-restore-redis <host>
3+
#/ Restore redis files from an rsync snapshot.
4+
#/
5+
#/ Note: This script typically isn't called directly. It's invoked by the
6+
#/ ghe-restore command.
7+
set -e
8+
9+
# Bring in the backup configuration
10+
# shellcheck source=share/github-backup-utils/ghe-backup-config
11+
. "$(dirname "${BASH_SOURCE[0]}")/ghe-backup-config"
12+
13+
# Show usage and bail with no arguments
14+
[[ -z ${*} ]] && print_usage
15+
16+
# Grab host arg
17+
GHE_HOSTNAME="${1}"
18+
19+
bm_start "$(basename "${0}")"
20+
21+
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-redis' < "$GHE_RESTORE_SNAPSHOT_PATH/redis.rdb" 1>&3
22+
23+
bm_end "$(basename "${0}")"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
#/ Usage: ghe-restore-ssh-keys <host>
3+
#/ Restore ssh keys from an rsync snapshot.
4+
#/
5+
#/ Note: This script typically isn't called directly. It's invoked by the
6+
#/ ghe-restore command.
7+
set -e
8+
9+
# Bring in the backup configuration
10+
# shellcheck source=share/github-backup-utils/ghe-backup-config
11+
. "$(dirname "${BASH_SOURCE[0]}")/ghe-backup-config"
12+
13+
# Show usage and bail with no arguments
14+
[[ -z ${*} ]] && print_usage
15+
16+
bm_start "$(basename "${0}")"
17+
18+
# Grab host arg
19+
GHE_HOSTNAME="${1}"
20+
GHE_RESTORE_SNAPSHOT_PATH="${2}"
21+
22+
bm_start "$(basename "${0}")"
23+
24+
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-authorized-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/authorized-keys.json" 1>&3
25+
26+
bm_end "$(basename "${0}")"

0 commit comments

Comments
 (0)