From 3348023d8fb6b6c6e5b07174ab105ab87a630ac5 Mon Sep 17 00:00:00 2001 From: Igor Diakonov Date: Wed, 25 Sep 2019 17:37:34 +0300 Subject: [PATCH] Added multithreading --- postgres-backup-s3/backup.sh | 2 +- postgres-restore-s3/restore.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/postgres-backup-s3/backup.sh b/postgres-backup-s3/backup.sh index dca744f..db84fe1 100644 --- a/postgres-backup-s3/backup.sh +++ b/postgres-backup-s3/backup.sh @@ -59,7 +59,7 @@ POSTGRES_HOST_OPTS="-h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER $POSTG echo "Creating dump of ${POSTGRES_DATABASE} database from ${POSTGRES_HOST}..." -pg_dump $POSTGRES_HOST_OPTS -Ft $POSTGRES_DATABASE | gzip > dump.sql.gz +pg_dump $POSTGRES_HOST_OPTS -Fc $POSTGRES_DATABASE | gzip > dump.sql.gz echo "Uploading dump to $S3_BUCKET" diff --git a/postgres-restore-s3/restore.sh b/postgres-restore-s3/restore.sh index f6df25d..58b04c2 100644 --- a/postgres-restore-s3/restore.sh +++ b/postgres-restore-s3/restore.sh @@ -73,7 +73,7 @@ fi echo "Restoring ${LATEST_BACKUP}" -pg_restore $POSTGRES_HOST_OPTS -C -c --if-exists --no-owner -v -d $POSTGRES_DATABASE dump.sql +pg_restore $POSTGRES_HOST_OPTS -C -c --if-exists --no-owner -j 4 -v -d $POSTGRES_DATABASE dump.sql echo "Restore complete"