mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
add postgres globals backup if SPLIT_DB=true
This commit is contained in:
committed by
GitHub
parent
f83f97bf76
commit
5f58ce81c8
@@ -332,6 +332,19 @@ backup_pgsql() {
|
||||
check_exit_code "move backup file"
|
||||
post_dbbackup $db
|
||||
done
|
||||
prepare_dbbackup
|
||||
target=pgsql_globals_${DB_HOST,,}_${now}.sql
|
||||
ltarget=pgsql_globals_${DB_HOST,,}
|
||||
compression
|
||||
pre_dbbackup "globals"
|
||||
print_notice "Dumping PostgresSQL globals: 'pg_dumpall -g' ${compression_string}"
|
||||
pg_dumpall -h ${DB_HOST} -U ${DB_USER} -p ${DB_PORT} -g | $compress_cmd > ${TEMP_LOCATION}/${target}
|
||||
exit_code=$?
|
||||
check_exit_code $target
|
||||
generate_checksum
|
||||
move_dbbackup
|
||||
check_exit_code "move backup file"
|
||||
post_dbbackup "globals"
|
||||
else
|
||||
print_debug "Not splitting database dumps into their own files"
|
||||
prepare_dbbackup
|
||||
|
||||
Reference in New Issue
Block a user