Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
rucciva committed Sep 15, 2023
1 parent 610cefd commit b3b6106
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ rclone_s3() {
--stats=10s \
$@
}

TIMESTAMP=$(date '+%Y-%-m-%d')
remote_path=":s3:backup-vira-sh/$APP_NAME/$DB_INSTANCE_NAME/$DB_NAME/$TIMESTAMP"
remote_path=":s3:${S3_BUCKET:-"bucket"}/$APP_NAME/$DB_INSTANCE_NAME/$DB_NAME/$TIMESTAMP"

PGPASSWORD=$DB_PASSWORD pg_dump -h $DB_HOST --no-publications --no-owner -U $DB_USERNAME -O -x -Fc $DB_NAME | rclone_s3 rcat "$remote_path"
PGPASSWORD=$DB_PASSWORD pg_dump \
-h $DB_HOST \
--no-publications \
--no-owner \
-U $DB_USERNAME \
-O -x -Fc $DB_NAME |
rclone_s3 rcat "$remote_path"

0 comments on commit b3b6106

Please sign in to comment.