unattended backupscript not working with 7.4.2, works in 7.1

From: "Development - multi(dot)art(dot)studio" <dev(dot)null(at)multiartstudio(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: unattended backupscript not working with 7.4.2, works in 7.1
Date: 2004-05-03 01:42:04
Message-ID: 4095A36C.2040709@multiartstudio.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2004-05-03 02:13:56 Re: unattended backupscript not working with 7.4.2, works in 7.1
Previous Message Peter Eisentraut 2004-05-02 23:54:20 Re: pgsql folder and its contents