Elasticsearch backup
Install JQ to make Json more human readable. #!/bin/bash # Backup of elasticsearch # Scenario: make backup of every open index once a day function write_to_stderr { echo “$@” 1>&2 } INDEX_TO_EXLUDE=”^_\|SOME_SPECIAL_INDEX” REPOSITORY=”backup” for INDEX_NAME in `curl ‘localhost:9200/_cat/indices?v’ 2>/dev/null | grep “\sopen\s” | awk ‘{print $3}’ `; do INDEX_LOG_FILE=”/tmp/bck.$INDEX_NAME.log” IS_SPECIAL_INDEX=`echo “$INDEX_NAME” | grep -c “$INDEX_TO_EXLUDE” […]