Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion infrastructure/backups/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,21 @@ docker run --rm \
echo ""
echo "Delete all currently existing snapshots"
echo ""
# Get list of snapshots as a simple array
snapshots=$(docker run --rm --network="$NETWORK" appropriate/curl \
-s "http://$(elasticsearch_host)/_snapshot/ocrvs/_all" | jq -r '.snapshots[].snapshot' || true)
echo "Found snapshots:"
echo "$snapshots" | sed 's/^/ - /'

for snap in $snapshots; do
echo "Deleting snapshot: $snap"
docker run --rm --network="$NETWORK" appropriate/curl \
-s -X DELETE -H "Content-Type: application/json;charset=UTF-8" \
"http://$(elasticsearch_host)/_snapshot/ocrvs/${snap}?wait_for_completion=true&pretty"
done
docker run --rm --network=$NETWORK appropriate/curl curl -sS -X DELETE -H "Content-Type: application/json;charset=UTF-8" "http://$(elasticsearch_host)/_snapshot/ocrvs"

echo "Waiting for snapshots to be removed"
sleep 30
#-------------------------------------------------------------------------------------
echo ""
echo "Register backup folder as an Elasticsearch repository for backing up the search data"
Expand Down
Loading
Loading