diff options
Diffstat (limited to 'app/backup/build/backup-matrix')
-rwxr-xr-x | app/backup/build/backup-matrix/do_backup.sh | 19 |
1 files changed, 16 insertions, 3 deletions
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" |