27
27
# Make sure root backup dir exists if this is the first run
28
28
mkdir -p " $GHE_SNAPSHOT_DIR /elasticsearch"
29
29
30
- # Create exclude file
31
- exclude_file=" $( mktemp) "
32
- echo elasticsearch.yml > " $exclude_file "
33
-
34
- # Exclude audit log indices when configuration says so and import to MySQL is complete
35
- # as those indices will be rebuilt from MySQL during a restore
36
- if [ " $GHE_BACKUP_ES_AUDIT_LOGS " = " no" ] && ghe-ssh " $host " test -e " /data/user/common/audit-log-import/complete" ; then
37
- ghe_verbose " * Excluding Audit Log indices"
38
- ghe-ssh " $host " curl -s ' http://localhost:9201/_cat/indices/audit_log?h=uuid' >> $exclude_file 2>&3
39
- fi
40
-
41
30
# Verify that the /data/elasticsearch directory exists.
42
31
if ! ghe-ssh " $host " -- " [ -d '$GHE_REMOTE_DATA_USER_DIR /elasticsearch' ]" ; then
43
32
ghe_verbose " * The '$GHE_REMOTE_DATA_USER_DIR /elasticsearch' directory doesn't exist."
@@ -58,7 +47,6 @@ ghe-rsync -avz \
58
47
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
59
48
--rsync-path=" sudo -u elasticsearch rsync" \
60
49
$link_dest \
61
- --exclude-from=" $exclude_file " \
62
50
" $( ssh_host_part " $host " ) :$GHE_REMOTE_DATA_USER_DIR /elasticsearch/" \
63
51
" $GHE_SNAPSHOT_DIR /elasticsearch" 1>&3
64
52
@@ -67,7 +55,6 @@ cleanup () {
67
55
ghe_verbose " * Enabling ES index flushing ..."
68
56
echo ' {"index":{"translog.disable_flush":false}}' |
69
57
ghe-ssh " $host " -- curl -s -XPUT " localhost:9200/_settings" -d @- > /dev/null
70
- rm -rf " $exclude_file "
71
58
}
72
59
trap ' cleanup' EXIT
73
60
trap ' exit $?' INT # ^C always terminate
@@ -84,7 +71,6 @@ ghe-rsync -avz \
84
71
-e " ghe-ssh -p $( ssh_port_part " $host " ) " \
85
72
--rsync-path=" sudo -u elasticsearch rsync" \
86
73
$link_dest \
87
- --exclude-from=" $exclude_file " \
88
74
" $( ssh_host_part " $host " ) :$GHE_REMOTE_DATA_USER_DIR /elasticsearch/" \
89
75
" $GHE_SNAPSHOT_DIR /elasticsearch" 1>&3
90
76
0 commit comments