Created
September 7, 2017 13:03
-
-
Save larsar/de672740f06a55ff7dd8bb42b2be9f29 to your computer and use it in GitHub Desktop.
Delete Elasticsearch snapshots for a date range
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
#!/usr/bin/env bash | |
d=2016-02-14 | |
while [ "$d" != 2016-03-01 ]; do | |
curl -X DELETE http://<HOST>/_snapshot/<INDEX>/snapshot-`echo $d | tr - .` -H 'content-type: application/json' | |
d=$(date -I -d "$d + 1 day") | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment