From 338a8ec7da79ecaccb70f2fbd7cecd385a32fae7 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 17 Apr 2021 12:21:13 +0200 Subject: Try to migrate to pg_basebackup --- app/backup/build/backup-matrix/do_backup.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'app/backup/build/backup-matrix') diff --git a/app/backup/build/backup-matrix/do_backup.sh b/app/backup/build/backup-matrix/do_backup.sh index 74cd9da..7461409 100755 --- a/app/backup/build/backup-matrix/do_backup.sh +++ b/app/backup/build/backup-matrix/do_backup.sh @@ -14,9 +14,22 @@ Host backuphost EOF echo "export sql" -# note, -Fc means that postgresql compresses the output -export PGPASSWORD=$MATRIX_PSQL_PWD -pg_dump -v -Fc -U $MATRIX_PSQL_USER -h 192.168.0.2 -p 5433 $MATRIX_PSQL_DB | \ +export PGPASSWORD=$REPL_PSQL_PWD +pg_basebackup \ + --pgdata=- \ + --format=tar \ + --max-rate=1M \ + --no-slot \ + --wal-method=none \ + --gzip \ + --compress=8 \ + --checkpoint=spread \ + --progress \ + --verbose \ + --status-interval=10 \ + --username=$REPL_PSQL_USER \ + --port=5432 \ + --host=psql-proxy.service.2.cluster.deuxfleurs.fr | \ age -r "$(cat /root/.ssh/id_ed25519.pub)" | \ ssh backuphost "cat > $TARGET_SSH_DIR/matrix/db-$(date --iso-8601=minute).gz.age" -- cgit v1.2.3