Skip to content

Commit 07e74ca

Browse files
authored
Merge pull request #228 from oscarsiles/main
add postgres globals backup if SPLIT_DB=true
2 parents 8fb2972 + 03d2362 commit 07e74ca

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
@@ -336,6 +336,19 @@ backup_pgsql() {
336336
check_exit_code move $target
337337
post_dbbackup $db
338338
done
339+
prepare_dbbackup
340+
target=pgsql_globals_${DB_HOST,,}_${now}.sql
341+
ltarget=pgsql_globals_${DB_HOST,,}
342+
compression
343+
pre_dbbackup "globals"
344+
print_notice "Dumping PostgresSQL globals: 'pg_dumpall -g' ${compression_string}"
345+
pg_dumpall -h ${DB_HOST} -U ${DB_USER} -p ${DB_PORT} -g | $compress_cmd > ${TEMP_LOCATION}/${target}
346+
exit_code=$?
347+
check_exit_code $target
348+
generate_checksum
349+
move_dbbackup
350+
check_exit_code "move backup file"
351+
post_dbbackup "globals"
339352
else
340353
print_debug "Not splitting database dumps into their own files"
341354
prepare_dbbackup

0 commit comments

Comments
 (0)