473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

unattended backupscript not working with 7.4.2, works in 7.1

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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
4 1430
On Mon, May 03, 2004 at 03:42:04AM +0200, Development - multi.art.studio wrote:
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


I think the difference is that the programs don't read the password from
stdin anymore; rather they expect it on /dev/tty. Maybe you could use
the ~/.pgpass file instead; read its documentation in the libpq section
of the manual.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Nadie esta tan esclavizado como el que se cree libre no siendolo" (Goethe)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #2
On Mon, May 03, 2004 at 03:42:04AM +0200, Development - multi.art.studio wrote:
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


I think the difference is that the programs don't read the password from
stdin anymore; rather they expect it on /dev/tty. Maybe you could use
the ~/.pgpass file instead; read its documentation in the libpq section
of the manual.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Nadie esta tan esclavizado como el que se cree libre no siendolo" (Goethe)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
"Development - multi.art.studio" <de******@multiartstudio.com> writes:
after updating some of my databases, everything works fine, except my
backupscripts.
any suggestions?


Set up a ~/.pgpass file for the account that's running the backup job.
Or switch to a non-password-based authentication mechanism.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #4
"Development - multi.art.studio" <de******@multiartstudio.com> writes:
after updating some of my databases, everything works fine, except my
backupscripts.
any suggestions?


Set up a ~/.pgpass file for the account that's running the backup job.
Or switch to a non-password-based authentication mechanism.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dmitry | last post by:
Hi folks! I need to find a way to switch to a different Unix user from within the Perl script that is currently ran unattended. Script must switch user in order to execute proper profile for...
0
by: ACI | last post by:
Auto Close Idle helps you utilize your multi-user concurrent users licenses more efficiently. It closes unattended clients remotely after a certain period of time or manually. Furthermore, clients...
3
by: Soren Mikkelsen | last post by:
Dear all, I am not sure this is the right forum so please bare with me that I've posted the same on fora: microsoft.public.dotnet.faq microsoft.public.dotnet.framework.setup...
6
by: Eric Robert | last post by:
Hi, I think I've tried everything I can without success. I want to bundle an application that can run unattended or not. That's means it can behave like a normal window application or a...
4
by: 28tommy | last post by:
Hi, I'm trying to automate an installation of some SW that is installed on Windows (you know - 'Start' ==> 'Next' ==> 'Next' ==> 'Finish' kind of installation). Is ther any way to perform that...
0
by: Development - multi.art.studio | last post by:
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...
3
by: steveeisen | last post by:
I'm a long-time VB6 programmer in a shop that is mostly moving to VB ..NET 2005. And I'm confused about coding the start of solutions for unattended operations. Much of what I write is old-time...
2
by: sp | last post by:
I am looking for a files .net 1.1 .net 2.0 .net 3.0 that can I integrate with Windows XP installation CD for unattended install. I am looking for an patches for it also.
1
by: =?Utf-8?B?Q29saW4gQmFrZXI=?= | last post by:
Hi, I recently read an article (and video) on MSDN about making a Windows Mobile device enter unattended mode instead of suspended mode when the the standby/power button is pressed. This allows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.