File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed
share/github-backup-utils Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ elif [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
344
344
fi
345
345
346
346
if $cluster ; then
347
- echo " Restoring ElasticSearch Audit logs"
347
+ echo " Restoring Elasticsearch Audit logs"
348
348
ghe-restore-es-audit-log " $GHE_HOSTNAME " 1>&3
349
349
350
350
echo " Restoring hookshot logs ..."
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# / Usage: ghe-backup-es-audit-log
3
- # / Take a backup of audit logs in ElasticSearch .
3
+ # / Take a backup of audit logs in Elasticsearch .
4
4
# /
5
5
# / Note: This command typically isn't called directly. It's invoked by
6
6
# / ghe-backup.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# / Usage: ghe-backup-es-hookshot
3
- # / Take a backup of hookshot logs in ElasticSearch .
3
+ # / Take a backup of hookshot logs in Elasticsearch .
4
4
# /
5
5
# / Note: This command typically isn't called directly. It's invoked by
6
6
# / ghe-backup.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# / Usage: ghe-restore-es-audit-log
3
- # / Take a backup of audit logs in ElasticSearch .
3
+ # / Restores a backup of audit logs to Elasticsearch .
4
4
# /
5
5
# / Note: This command typically isn't called directly. It's invoked by
6
- # / ghe-backup .
6
+ # / ghe-restore .
7
7
set -e
8
8
9
9
# Bring in the backup configuration
@@ -19,14 +19,14 @@ GHE_HOSTNAME="$1"
19
19
# Perform a host-check and establish GHE_REMOTE_XXX variables.
20
20
ghe_remote_version_required " $GHE_HOSTNAME "
21
21
22
- last_index=$( ghe-ssh " $GHE_HOSTNAME " ' curl -s "localhost:9201/_cat/indices/audit_log*"' | cut -d ' ' -f 3 | sort | tail -1)
22
+ last_index=$( ghe-ssh " $GHE_HOSTNAME " ' curl -s "localhost:9201/_cat/indices/audit_log*"' | cut -d ' ' -f 3 | sort | tail -2 | head - 1)
23
23
24
24
indices=$( ls -1 $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /audit-log/* .gz 2> /dev/null | xargs -I{} -n1 basename {} .gz)
25
25
26
26
for index in $indices ; do
27
27
if [ -z " $last_index " ] || ! [ $index \< $last_index ]; then
28
- echo " Restoring $index "
29
- gzip -dc $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /audit-log/$index .gz | ghe-ssh " $GHE_HOSTNAME " " /usr/local/share/enterprise/ghe-es-load-json 'http://localhost:9201/$index '"
28
+ ghe_verbose " * Restoring $index "
29
+ gzip -dc $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /audit-log/$index .gz | ghe-ssh " $GHE_HOSTNAME " " /usr/local/share/enterprise/ghe-es-load-json 'http://localhost:9201/$index '" 1>&3
30
30
fi
31
31
done
32
32
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# / Usage: ghe-restore-es-hookshot
3
- # / Restores a backup of hookshot logs to ElasticSearch .
3
+ # / Restores a backup of hookshot logs to Elasticsearch .
4
4
# /
5
5
# / Note: This command typically isn't called directly. It's invoked by
6
6
# / ghe-restore.
@@ -19,7 +19,7 @@ GHE_HOSTNAME="$1"
19
19
# Perform a host-check and establish GHE_REMOTE_XXX variables.
20
20
ghe_remote_version_required " $GHE_HOSTNAME "
21
21
22
- last_index=$( ghe-ssh " $GHE_HOSTNAME " ' curl -s "localhost:9201/_cat/indices/hookshot-logs-*"' | cut -d ' ' -f 3 | sort | tail -1)
22
+ last_index=$( ghe-ssh " $GHE_HOSTNAME " ' curl -s "localhost:9201/_cat/indices/hookshot-logs-*"' | cut -d ' ' -f 3 | sort | tail -2 | head - 1)
23
23
24
24
indices=$( ls -1 $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /hookshot/* .gz 2> /dev/null | xargs -I{} -n1 basename {} .gz)
25
25
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ bm_start "$(basename $0)"
21
21
# us run this script directly.
22
22
: ${GHE_RESTORE_SNAPSHOT:= current}
23
23
24
- # Restore ElasticSearch indices from tarball snapshot.
24
+ # Restore Elasticsearch indices from tarball snapshot.
25
25
ghe-ssh " $GHE_HOSTNAME " -- ' ghe-import-es-indices' \
26
26
< " $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /elasticsearch.tar" 1>&3
27
27
You can’t perform that action at this time.
0 commit comments