From 5f58ce81c83e2e110c3272b6b349437f3cd0c630 Mon Sep 17 00:00:00 2001 From: Oscar Siles Brugge <48240545+oscarsiles@users.noreply.github.com> Date: Wed, 7 Jun 2023 09:19:25 +0100 Subject: [PATCH] add postgres globals backup if SPLIT_DB=true --- install/assets/functions/10-db-backup | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install/assets/functions/10-db-backup b/install/assets/functions/10-db-backup index 77bbeaf..8f781e4 100644 --- a/install/assets/functions/10-db-backup +++ b/install/assets/functions/10-db-backup @@ -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