unattended backupscript not working with 7.4.2, works in 7.1 - Mailing list pgsql-general

From Development - multi.art.studio
Subject unattended backupscript not working with 7.4.2, works in 7.1
Date
Msg-id 4095A36C.2040709@multiartstudio.com
Whole thread Raw
Responses Re: unattended backupscript not working with 7.4.2, works in 7.1
Re: unattended backupscript not working with 7.4.2, works in 7.1
List pgsql-general
Hello to the List,

i have a question about backing up my fresh updated databases :)
after updating some of my databases, everything works fine, except my
backupscripts.
i run this script as root from cronjob with su - postgres -c "...script..."
it works fine with postgres 7.1, but in 7.4.2 something seems to have
changed on the behaviour of psql, and pg_dump

my pg_hba.conf is as follow, same values in 7.1

local   all         all                                             password
host    all     all     0.0.0.0         0.0.0.0         password

my script looks like that:

#! /bin/sh
...
...
PASSWORDFILE=$DBHOME/pass
USERPASSWORDFILE=$DBHOME/user-pass
PORTS="5433 5434"
...
for port in $PORTS; do
        export PGPORT=$port
        DBs=$($DBHOME/bin/psql -t -c "select datname from pg_database"
template1 <$PASSWORDFILE)

        for DB in $DBs; do
                mkdir -p $BACKUPDIR/$DB

                #sheme backup with createDB
                ARCHIVENAME=$DB.$Date.tplC.sql.gz
                $DBHOME/bin/pg_dump -x -s -C $DB -u < $USERPASSWORDFILE
| gzip -9 > $BACKUPDIR/$DB/$ARCHIVENAME
                echo "$DB:$ARCHIVENAME" >> $LOGFILE
....and so on

as i use pg_dump from 7.1 with my 7.1 databases, script runs without
asking for a password
but when i tried it with 7.4.2 binaries (psql, pg_dump) on my 7.4.2
database  then i was asked for a password, and thats not what a cronjob
can answer to ;)

i changed the lines above to use -U postgres and only $PASSWORDFILE for
input, but this doesnt help...

any suggestions?
thanks for reading and comments,

yours sincerely
volker



pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql folder and its contents
Next
From: Alvaro Herrera
Date:
Subject: Re: unattended backupscript not working with 7.4.2, works in 7.1