From b3b6106548b1a3e26b8effb5d17bacd4d2e17ea3 Mon Sep 17 00:00:00 2001 From: Rucciva Date: Fri, 15 Sep 2023 08:37:32 +0700 Subject: [PATCH] tidy up --- backup.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index d628b6c..9d680d6 100755 --- a/backup.sh +++ b/backup.sh @@ -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" \ No newline at end of file +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"