Skip to content

Commit a772613

Browse files
authored
Merge pull request #720 from github/backup-progress-file-for-ha
Backup progress file for ha setup
2 parents 37916a6 + eabec34 commit a772613

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

share/github-backup-utils/ghe-backup-repositories

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ if [ "$GHE_BACKUP_STRATEGY" = "cluster" ]; then
7878
ghe-ssh-config "$GHE_HOSTNAME" "$hostnames" > "$ssh_config_file"
7979
fi
8080

81+
# hostnames for HA
82+
if ghe-ssh "$GHE_HOSTNAME" -- \
83+
"[ -f '$GHE_REMOTE_ROOT_DIR/etc/github/cluster' ] && [ -f '$GHE_REMOTE_ROOT_DIR/etc/github/repl-state' ]"; then
84+
hostnames=$(ghe-ssh "$GHE_HOSTNAME" ghe-cluster-nodes -i | cut -f 2)
85+
fi
86+
8187
# Make sure root backup dir exists if this is the first run
8288
mkdir -p "$backup_dir"
8389

share/github-backup-utils/ghe-backup-storage

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ if [ "$GHE_BACKUP_STRATEGY" = "cluster" ]; then
5151
ghe-ssh-config "$GHE_HOSTNAME" "$hostnames" > "$ssh_config_file"
5252
fi
5353

54+
# hostnames for HA
55+
if ghe-ssh "$GHE_HOSTNAME" -- \
56+
"[ -f '$GHE_REMOTE_ROOT_DIR/etc/github/cluster' ] && [ -f '$GHE_REMOTE_ROOT_DIR/etc/github/repl-state' ]"; then
57+
hostnames=$(ghe-ssh "$GHE_HOSTNAME" ghe-cluster-nodes -i | cut -f 2)
58+
fi
59+
5460
# Make sure root backup dir exists if this is the first run
5561
mkdir -p "$backup_dir"
5662

0 commit comments

Comments
 (0)