File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
share/github-backup-utils Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,13 @@ ghe_remote_version_required "$host"
19
19
# Make sure root backup dir exists if this is the first run
20
20
mkdir -p " $GHE_SNAPSHOT_DIR /audit-log"
21
21
22
- if ! indices=$( ghe-ssh " $host " ' curl -s "localhost:9201/_cat/indices/audit_log*?h=index"' ) ; then
22
+ if [ $GHE_VERSION_MAJOR -ge 2 ] && [ $GHE_VERSION_MINOR -ge 2 ]; then
23
+ es_port=9201
24
+ else
25
+ es_port=9200
26
+ fi
27
+
28
+ if ! indices=$( ghe-ssh " $host " " curl -s \" localhost:$es_port /_cat/indices/audit_log*?h=index" \" ) ; then
23
29
echo " Error: failed to retrieve audit log indices." 1>&2
24
30
exit 1
25
31
fi
@@ -31,6 +37,6 @@ for index in $indices; do
31
37
# Hard link any older indices since they are read only and won't change
32
38
ln $GHE_DATA_DIR /current/audit-log/$index .gz $GHE_SNAPSHOT_DIR /audit-log/$index .gz
33
39
else
34
- ghe-ssh " $host " " /usr/local/share/enterprise/ghe-es-dump-json ' http://localhost:9201 /$index ' " | gzip > $GHE_SNAPSHOT_DIR /audit-log/$index .gz
40
+ ghe-ssh " $host " " /usr/local/share/enterprise/ghe-es-dump-json \" http://localhost:$es_port /$index \" " | gzip > $GHE_SNAPSHOT_DIR /audit-log/$index .gz
35
41
fi
36
42
done
You can’t perform that action at this time.
0 commit comments