DB Schema
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
FILE_NAME=dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql.br
|
||||
FILE_NAME=data-dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql.br
|
||||
FILE_NAME_COMPLETE=full-dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql.br
|
||||
# Wir exportieren die Datenbank und komprimieren sie.
|
||||
docker exec -t online-energieausweis-database-1 pg_dumpall -c -U main | brotli --best > $FILE_NAME
|
||||
docker exec -t online-energieausweis-database-1 pg_dump --data-only -U main main | brotli --best > $FILE_NAME
|
||||
docker exec -t online-energieausweis-database-1 pg_dumpall -c -U main | brotli --best > $FILE_NAME_COMPLETE
|
||||
|
||||
# Das wird benötigt für AWS Ionos Kompatibilität.
|
||||
export AWS_REQUEST_CHECKSUM_CALCULATION=when_required
|
||||
@@ -12,6 +14,8 @@ export AWS_RESPONSE_CHECKSUM_VALIDATION=when_required
|
||||
# Das Profil kann mit `aws configure --profile ionos` erstellt werden.
|
||||
# Den Key dafür findet man auf https://dcd.ionos.com/latest/?lang=en#/key-management
|
||||
aws s3 cp $FILE_NAME s3://ibc-db-backup/ --profile ionos --endpoint-url https://s3-eu-central-1.ionoscloud.com --storage-class STANDARD
|
||||
aws s3 cp $FILE_NAME_COMPLETE s3://ibc-db-backup/ --profile ionos --endpoint-url https://s3-eu-central-1.ionoscloud.com --storage-class STANDARD
|
||||
|
||||
# Wir entfernen das Backup
|
||||
rm $FILE_NAME
|
||||
rm $FILE_NAME
|
||||
rm $FILE_NAME_COMPLETE
|
||||
Reference in New Issue
Block a user