added gzip to backups to save some space

This commit is contained in:
Yannic Kilcher
2023-02-11 14:12:04 +01:00
parent 55a52fd61f
commit 583c4f546a
+2 -2
View File
@@ -4,10 +4,10 @@ set -e
set -x
# filename with timestamp
filename="postgres-$(date +%Y-%m-%d_%H-%M-%S).sql"
filename="postgres-$(date +%Y-%m-%d_%H-%M-%S).sql.gz"
# perform pg_dump
pg_dump -U postgres postgres > /tmp/$filename
pg_dump -U postgres postgres | gzip -c > /tmp/$filename
# upload to s3
aws s3 cp /tmp/$filename s3://$S3_BUCKET_NAME/$filename