Skip to content

Commit 322791e

Browse files
authored
Merge pull request #333 from github/lildude/fix-es-transition-detection
Determine if audit log migration needs to take place as part of backup
2 parents 9b4bdd8 + 5ab4577 commit 322791e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

share/github-backup-utils/ghe-backup-es-audit-log

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ if ! indices=$(ghe-ssh "$host" "curl -s \"localhost:$es_port/_cat/indices/audit_
3131
exit 1
3232
fi
3333

34+
# Determine if the audit log migration has occurred or is needed.
35+
if echo 'set -o pipefail; ! test -e /data/user/common/es-scan-complete && test -f /usr/local/share/enterprise/run-audit-log-transitions.sh' | ghe-ssh "$host" /bin/bash; then
36+
if echo 'set -o pipefail; echo n | /usr/local/share/enterprise/run-audit-log-transitions.sh > /dev/null 2>&1 && touch /data/user/common/es-scan-complete' | ghe-ssh "$host" /bin/bash; then
37+
touch $GHE_SNAPSHOT_DIR/es-scan-complete
38+
fi
39+
fi
40+
3441
current_index=audit_log-$(ghe-ssh "$host" 'date +"%Y-%m"')
3542

3643
for index in $indices; do

0 commit comments

Comments
 (0)