This file contains hidden or 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
# https://superuser.com/a/1922906 | |
name='dir1' ; zip -r "$name.zip" "$name" -x "$name/.git*" -x "$name/.idea*" |
This file contains hidden or 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
# temp file in $TMPDIR or /tmp | |
TMPFILE="$(mktemp)" | |
trap '{ rm -f -- "$TMPFILE" ; }' EXIT | |
# temp file relative to current script | |
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE:-$0}")" &> /dev/null && pwd)" | |
TMPFILE="$(mktemp -p "$SCRIPT_DIR")" | |
trap '{ rm -f -- "$TMPFILE" ; }' EXIT | |
# temp directory in $TMPDIR or /tmp |
This file contains hidden or 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
# Get indexes | |
curl 'http://localhost:9200/_cat/indices?v' | |
# Get index data | |
curl 'http://localhost:9200/index_name?pretty' | |
# Refresh all | |
for index in $(curl -s 'http://localhost:9200/_cat/indices?h=index'); do curl -sX POST "http://localhost:9200/$index/_refresh" ; echo " $index" ; done |