Browse Source

Merge pull request #77 from claudyus/master

postgres-backup-s3: Prepend the database name to S3 filename
pull/78/head
Johannes Schickling 8 years ago
committed by GitHub
parent
commit
7136f1c373
  1. 2
      postgres-backup-s3/backup.sh

2
postgres-backup-s3/backup.sh

@ -57,6 +57,6 @@ pg_dump $POSTGRES_HOST_OPTS $POSTGRES_DATABASE | gzip > dump.sql.gz
echo "Uploading dump to $S3_BUCKET" echo "Uploading dump to $S3_BUCKET"
cat dump.sql.gz | aws s3 cp - s3://$S3_BUCKET/$S3_PREFIX/$(date +"%Y-%m-%dT%H:%M:%SZ").sql.gz || exit 2
cat dump.sql.gz | aws s3 cp - s3://$S3_BUCKET/$S3_PREFIX/${POSTGRES_DATABASE}_$(date +"%Y-%m-%dT%H:%M:%SZ").sql.gz || exit 2
echo "SQL backup uploaded successfully" echo "SQL backup uploaded successfully"
Loading…
Cancel
Save