forked from ISTI-ansible-roles/ansible-roles
library/roles/postgresql/files/postgresql-backup.sh: Fix the command line that builds the list of DBs to be backed up.
This commit is contained in:
parent
73cb1d655c
commit
27c8815b25
|
@ -34,7 +34,8 @@ LOCKFILE=${BACKUPDIR}/.dumplock
|
|||
umask 0077
|
||||
if [ "$BUILD_DBLIST" == "yes" ] ; then
|
||||
# The psql -l command prints too much stuff
|
||||
DB_LIST=$( psql -q -t -l -U postgres | grep -v template0 | grep -v template1 | grep -v : | grep -v ^\( | grep -v ^\- | awk '{print $1}' )
|
||||
#DB_LIST=$( psql -q -t -l -U postgres | grep -v template0 | grep -v template1 | grep -v : | grep -v ^\( | grep -v ^\- | awk '{print $1}' )
|
||||
DB_LIST=$( su - postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/oid2name " | awk '{print $2}' | tail -n +4 | grep -v template0 | grep -v template1 )
|
||||
fi
|
||||
|
||||
if [ ! -f $LOCKFILE ] ; then
|
||||
|
|
Loading…
Reference in New Issue