Skip to content

Commit bc52bca

Browse files
committed
Migrated to the custom format
1 parent be373c2 commit bc52bca

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

backup.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ POSTGRES_HOST_OPTS="-h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER $POSTG
5959

6060
echo "Creating dump of ${POSTGRES_DATABASE} database from ${POSTGRES_HOST}..."
6161

62-
pg_dump $POSTGRES_HOST_OPTS $POSTGRES_DATABASE | gzip > dump.sql.gz
62+
pg_dump -Fc $POSTGRES_HOST_OPTS $POSTGRES_DATABASE > db.dump
6363

6464
echo "Uploading dump to $S3_BUCKET"
6565

66-
cat dump.sql.gz | aws $AWS_ARGS s3 cp - s3://$S3_BUCKET/$S3_PREFIX/${POSTGRES_DATABASE}_$(date +"%Y-%m-%dT%H:%M:%SZ").sql.gz || exit 2
66+
cat db.dump | aws $AWS_ARGS s3 cp - s3://$S3_BUCKET/$S3_PREFIX/${POSTGRES_DATABASE}_$(date +"%Y-%m-%dT%H:%M:%SZ").dump || exit 2
6767

68-
echo "SQL backup uploaded successfully"
68+
echo "DB backup uploaded successfully"
69+
70+
rm db.dump
6971

7072
if [ -n $HEALTHCHECKS_IO_CHECK_ID ]; then
7173
echo "Notifying healthchecks.io"

0 commit comments

Comments
 (0)