Skip to content
Snippets Groups Projects

pgsql backup: show database name

Merged Hahn Axel (hahn) requested to merge update-localdump-to-classlike-functions into master
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -54,7 +54,7 @@ function doPgsqlBackup(){
@@ -54,7 +54,7 @@ function doPgsqlBackup(){
sSqlGetDblist="select datname from pg_database where not datistemplate and datallowconn order by datname;"
sSqlGetDblist="select datname from pg_database where not datistemplate and datallowconn order by datname;"
for DATABASE in $(su ${PGUSER} -c "psql -At -c '$sSqlGetDblist' postgres" 2>/dev/null)
for DATABASE in $(su ${PGUSER} -c "psql -At -c '$sSqlGetDblist' postgres" 2>/dev/null)
do
do
echo -n "__DB__${SERVICENAME} backup $_dbname ... "
echo -n "__DB__${SERVICENAME} backup $DATABASE ... "
OUTFILE="${BACKUP_TARGETDIR}/$(get_outfile ${DATABASE}).sql"
OUTFILE="${BACKUP_TARGETDIR}/$(get_outfile ${DATABASE}).sql"
su ${PGUSER} -c "pg_dump -Fp ${DATABASE} >$OUTFILE"
su ${PGUSER} -c "pg_dump -Fp ${DATABASE} >$OUTFILE"
fetchrc >/dev/null
fetchrc >/dev/null
Loading