File tree Expand file tree Collapse file tree 5 files changed +2538
-1324
lines changed
Expand file tree Collapse file tree 5 files changed +2538
-1324
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,21 @@ docker run --rm \
220220echo " "
221221echo " Delete all currently existing snapshots"
222222echo " "
223+ # Get list of snapshots as a simple array
224+ snapshots=$( docker run --rm --network=" $NETWORK " appropriate/curl \
225+ -s " http://$( elasticsearch_host) /_snapshot/ocrvs/_all" | jq -r ' .snapshots[].snapshot' || true)
226+ echo " Found snapshots:"
227+ echo " $snapshots " | sed ' s/^/ - /'
228+
229+ for snap in $snapshots ; do
230+ echo " Deleting snapshot: $snap "
231+ docker run --rm --network=" $NETWORK " appropriate/curl \
232+ -s -X DELETE -H " Content-Type: application/json;charset=UTF-8" \
233+ " http://$( elasticsearch_host) /_snapshot/ocrvs/${snap} ?wait_for_completion=true&pretty"
234+ done
223235docker run --rm --network=$NETWORK appropriate/curl curl -sS -X DELETE -H " Content-Type: application/json;charset=UTF-8" " http://$( elasticsearch_host) /_snapshot/ocrvs"
224-
236+ echo " Waiting for snapshots to be removed"
237+ sleep 30
225238# -------------------------------------------------------------------------------------
226239echo " "
227240echo " Register backup folder as an Elasticsearch repository for backing up the search data"
You can’t perform that action at this time.
0 commit comments