Skip to content

Commit 79ff03b

Browse files
authored
Merge pull request #1122 from opencrvs/sync-dev-with-1.9
chore: merge release-v1.9.0 into develop
2 parents 241b8a5 + f6c1b06 commit 79ff03b

File tree

5 files changed

+2538
-1324
lines changed

5 files changed

+2538
-1324
lines changed

infrastructure/backups/backup.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,21 @@ docker run --rm \
220220
echo ""
221221
echo "Delete all currently existing snapshots"
222222
echo ""
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
223235
docker 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
#-------------------------------------------------------------------------------------
226239
echo ""
227240
echo "Register backup folder as an Elasticsearch repository for backing up the search data"

0 commit comments

Comments
 (0)