Re: Help automate pg_dump

From: "Bjoern Metzdorf" <bm(at)turtle-entertainment(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help automate pg_dump
Date: 2002-06-18 14:21:07
Message-ID: 034d01c216d3$62eb6620$81c206d4@office.turtleentertainment.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Please let the list know if you get a solution, I am about to go to 7.2 on
> my production machines but that could be a show stopper if the cron job
> cannot automatically back it up anymore.

You might try this with expect (customizing necessary):

#!/usr/bin/expect -f
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd

set password xxx
spawn /usr/bin/psql -d db
expect "password:"
sleep 1
send "$password\r"
expect "password:"
sleep 1
send "$password\r"
expect eof

Greetings,
Bjoern

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Beutin 2002-06-18 14:26:10 Re: Accessing another db?
Previous Message Andrew Sullivan 2002-06-18 14:20:09 Re: Are there any "official" PostgreSQL banners available.