Skip to content

Commit c24cb94

Browse files
committed
fix: Backup/Restore scripts
1 parent f4e68de commit c24cb94

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

infrastructure/backups/backup.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,6 @@ done
207207
# Backup PostgreSQL
208208
# -----------------
209209

210-
echo "Backing up PostgreSQL 'events' database"
211-
docker run --rm \
212-
-e PGPASSWORD=$POSTGRES_PASSWORD \
213-
-v $ROOT_PATH/backups/postgres:/backups \
214-
--network=$NETWORK \
215-
postgres:17 \
216-
bash -c "pg_dump -h postgres -U $POSTGRES_USER -d events -F c -f /backups/events-${LABEL:-$BACKUP_DATE}.dump"
217-
218-
# Backup PostgreSQL
219-
# -----------------
220-
221210
echo "Backing up PostgreSQL 'events' database"
222211
docker run --rm \
223212
-e PGPASSWORD=$POSTGRES_PASSWORD \
@@ -260,6 +249,7 @@ create_elasticsearch_backup() {
260249
echo "Target indices for backup: $indices"
261250
OUTPUT=""
262251
OUTPUT=$(docker run --rm --network=$NETWORK appropriate/curl curl -sS -X PUT -H "Content-Type: application/json;charset=UTF-8" "http://$(elasticsearch_host)/_snapshot/ocrvs/snapshot_${LABEL:-$BACKUP_DATE}?wait_for_completion=true&pretty" -d \"{\"indices\": \"${indices}\"}\" 2>/dev/null)
252+
echo "Elasticsearch snapshot response: $OUTPUT"
263253
if echo $OUTPUT | jq -e '.snapshot.state == "SUCCESS"' > /dev/null; then
264254
echo "Snapshot state is SUCCESS"
265255
else

0 commit comments

Comments
 (0)