Skip to content

Commit 686faed

Browse files
committed
- create folder per configuration
1 parent 452b518 commit 686faed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backups/src/pg_backup_rotated.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ function perform_backups()
1717
local db_user=$4
1818

1919
backup_date=`date +%Y-%m-%d`
20-
backup_file_path="${BACKUP_DIR}${backup_date}${suffix}".backup
20+
backup_file_path="${BACKUP_DIR}${db_host}/${backup_date}${suffix}".backup
2121
backup_progress_file_path="${BACKUP_TMP_DIR}${backup_date}${suffix}".backup
2222
backup_roles_file_path="${backup_file_path}_roles.out"
2323
backup_progress_roles_file_path="${backup_progress_file_path}_roles.out"
2424

25+
mkdir -p "$(dirname "${backup_file_path}")"
26+
2527
if [[ -e ${backup_file_path} ]]; then
2628
log "${backup_file_path} already exists, skipping dump"
2729
return 1

0 commit comments

Comments
 (0)