Created
October 23, 2017 17:41
-
-
Save wardbekker/cfe52913fb6af1275243eefa39421163 to your computer and use it in GitHub Desktop.
Dump all local indices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INPUT=http://localhost:9200 | |
indices=$(curl -s -XGET $INPUT/_cat/indices?h=i) | |
for INDEX in $indices | |
do | |
echo $INDEX | |
elasticdump --input=$INPUT/$INDEX --output=$ --type=data | gzip > "${INDEX}_data.json.gz" | |
elasticdump --input=$INPUT/$INDEX --output="${INDEX}_mapping.json" --type=mapping | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment