Skip to content

Commit 08fd493

Browse files
committed
ghe-restore-es-rsync exits with warning when elasticsearch directory missing
ES backups aren't supported against v2.x appliances yet. Skip on the restore side too.
1 parent f147183 commit 08fd493

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libexec/ghe-restore-es-rsync

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ if ! tar --version | grep -q GNU; then
3030
fi
3131

3232
# Transfer all ES data from the latest snapshot to the GitHub instance.
33-
34-
if [ "$GHE_VERSION_MAJOR" -gt 1 ]; then
33+
if [ ! -d "$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/elasticsearch" ]; then
34+
echo "Warning: Elasticsearch backup missing. Skipping ..."
35+
exit 0
36+
elif [ "$GHE_VERSION_MAJOR" -gt 1 ]; then
3537
cd "$GHE_DATA_DIR/$GHE_RESTORE_SNAPSHOT/elasticsearch"
3638
ghe-ssh "$host" -- "sudo mkdir -p '$GHE_REMOTE_DATA_USER_DIR/elasticsearch-legacy'" 1>&3
3739

0 commit comments

Comments
 (0)