From f02d4bf238bc8c992e48a6b7eda0d51a57dd6525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Fri, 15 Nov 2013 12:16:50 +0100 Subject: [PATCH] Added a way of backuping ElasticSearch Conflicts: zzz_evobackup --- install/etc/evobackup/actions.d/14_elasticsearch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 install/etc/evobackup/actions.d/14_elasticsearch diff --git a/install/etc/evobackup/actions.d/14_elasticsearch b/install/etc/evobackup/actions.d/14_elasticsearch new file mode 100755 index 0000000..c4f0891 --- /dev/null +++ b/install/etc/evobackup/actions.d/14_elasticsearch @@ -0,0 +1,15 @@ +# Dump ElasticSearch +# Disable ES translog flush +curl -s -XPUT 'localhost:9200/_settings' -d '{"index.translog.disable_flush": true}' >/dev/null +# Flushes translog +curl -s 'localhost:9200/_flush' | grep -qe '"ok":true' +# If it succeed, do an rsync of the datadir +if [ $? -eq 0 ]; then + rsync -a /var/lib/elasticsearch /home/backup/ +else + echo "Error when flushing ES translog indexes." +fi +# In any case re-enable translog flush +curl -s -XPUT 'localhost:9200/_settings' -d '{"index.translog.disable_flush": false}' > /dev/null + +exit 0 \ No newline at end of file