diff --git a/logical-backup/dump.sh b/logical-backup/dump.sh index 1ea6e49..da7f761 100755 --- a/logical-backup/dump.sh +++ b/logical-backup/dump.sh @@ -124,11 +124,12 @@ function aws_upload { function aws_upload_dir { declare -r EXPECTED_SIZE="$1" - + declare -r DB_NAME="$2" + # mimic bucket setup from Spilo # to keep logical backups at the same path as WAL # NB: $LOGICAL_BACKUP_S3_BUCKET_SCOPE_SUFFIX already contains the leading "/" when set by the Postgres Operator - PATH_TO_BACKUP="s3://${LOGICAL_BACKUP_S3_BUCKET}/${POSTGRES_OPERATOR}/${LOGICAL_BACKUP_S3_BUCKET_SCOPE_SUFFIX}/${PGUSER}/logical_backups/$(date +%s)" + PATH_TO_BACKUP="s3://${LOGICAL_BACKUP_S3_BUCKET}/${POSTGRES_OPERATOR}/${LOGICAL_BACKUP_S3_BUCKET_SCOPE_SUFFIX}/${PGUSER}/logical_backups/${DB_NAME}/$(date +%s)" args=()