dump_postgresql_per_base: return if postgresql directory is missing
This commit is contained in:
parent
a9d90fc937
commit
a791d752f0
2 changed files with 4 additions and 1 deletions
|
@ -23,6 +23,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
|||
|
||||
* dump_redis: do not delete entire backup directory
|
||||
* dump_redis: clean backup directory only if the Redis instance is valid
|
||||
* dump_postgresql_per_base: return if postgresql directory is missing
|
||||
|
||||
### Security
|
||||
|
||||
|
|
|
@ -356,8 +356,10 @@ dump_postgresql_per_base() {
|
|||
fi
|
||||
fi
|
||||
|
||||
cd /var/lib/postgresql
|
||||
cd /var/lib/postgresql || { log "LOCAL_TASKS - ${FUNCNAME[0]}: /var/lib/postgresql not found"; return; }
|
||||
|
||||
databases=$(sudo -u postgres psql -U postgres ${connect_options[*]} -lt | awk -F \| '{print $1}' | grep -v "template.*")
|
||||
|
||||
for database in ${databases} ; do
|
||||
local error_file="${errors_dir}/${database}.err"
|
||||
local dump_file="${dump_dir}/${database}.sql${dump_ext}"
|
||||
|
|
Loading…
Add table
Reference in a new issue