473,409 Members | 2,057 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,409 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 1432
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.