Skip to content

Instantly share code, notes, and snippets.

@SamyCoenen
Created March 26, 2018 21:40
Show Gist options
  • Save SamyCoenen/6e12cc1c22c74733c6e5fc49bcb94b67 to your computer and use it in GitHub Desktop.
Save SamyCoenen/6e12cc1c22c74733c6e5fc49bcb94b67 to your computer and use it in GitHub Desktop.
Make a backup of all you indices on ElasticSearch with this Bash Script
#!/bin/bash
# Author: Samy Coenen
# Company: Gluo NV
SOURCE=https://............es.amazonaws.com
indice_list="$(curl -XGET $SOURCE/_cat/indices?pretty=true -v | cut -d $' ' -f3)"
for item in $indice_list
do
elasticdump \
--input=$SOURCE/$item \
--output=$ \
--type=data \
> "${item}elasticsearch-exported.json"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment