Skip to content

Commit 5f58ce8

Browse files
authored
add postgres globals backup if SPLIT_DB=true
1 parent f83f97b commit 5f58ce8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

install/assets/functions/10-db-backup

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,19 @@ backup_pgsql() {
332332
check_exit_code "move backup file"
333333
post_dbbackup $db
334334
done
335+
prepare_dbbackup
336+
target=pgsql_globals_${DB_HOST,,}_${now}.sql
337+
ltarget=pgsql_globals_${DB_HOST,,}
338+
compression
339+
pre_dbbackup "globals"
340+
print_notice "Dumping PostgresSQL globals: 'pg_dumpall -g' ${compression_string}"
341+
pg_dumpall -h ${DB_HOST} -U ${DB_USER} -p ${DB_PORT} -g | $compress_cmd > ${TEMP_LOCATION}/${target}
342+
exit_code=$?
343+
check_exit_code $target
344+
generate_checksum
345+
move_dbbackup
346+
check_exit_code "move backup file"
347+
post_dbbackup "globals"
335348
else
336349
print_debug "Not splitting database dumps into their own files"
337350
prepare_dbbackup

0 commit comments

Comments
 (0)