Обсуждение: pg_dumpall backup script w. ftp ; pgpass file ; after upgrade to Ubuntu 10.4 (lucid) and Postgresql 9.0.2

Поиск
Список
Период
Сортировка

pg_dumpall backup script w. ftp ; pgpass file ; after upgrade to Ubuntu 10.4 (lucid) and Postgresql 9.0.2

От
MargaretGillon@chromalloy.com
Дата:
<font face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D"2">After a year I have restarted work on a project using Postgresq=
l. The database I created was in Postgresql 8.2.5. I updated my database se=
rver from Ubuntu 7.10 to 10.4 (lucid)  and installed Postgresql 9.0.2 =
The Postgresql install went fine and the restore from my previous pg_dumpal=
l went fine but I have an issue with the backup script.I have made =
the pgpass file as root but I cannot get the backup script to run as root I=
 must change to a postgresql/ubuntu user engineering and then the script ru=
ns. Previously the backup script ran from cron.daily . I need to know what =
I am not doing correctly for this to work. I do not have much scripting exp=
erience. The error message is root@claLinus:/# source /etc/cron=
.daily/postgresql-backup.shpg_dumpall: could not connect to database "t=
emplate1": FATAL:  Ident authentication failed for user "engineering"<=
br>I have confirmed that .pgpass exists root@claLinus:/=
# locate .pgpass/home/engineering/.pgpass/home/mmg/.pgpass/root=
/.pgpass<font face=3D"Default Sans Serif,Verdana,Arial,Helvet=
ica,sans-serif" size=3D"2">Below is my backup script and my instructions fo=
r creating the pgpass that came from this list several years ago</f=
ont>Thank you for any help.Margaret <font fac=
e=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=3D"2">***&=
nbsp;*** *** *** *** *** *** *** ***&nbs=
p;*** *** *** *** *** *** *** *** *=
** *** ***#!/bin/bash#file is /etc/cron.dai=
ly/postgresql-backup.sh#store the file name into a variablenumdate=
=3D$(date +%F)-$(date +%k%M)owl.sql#remove spaces from the file name<br=
>numdate=3D${numdate/ /}#backup the databasepg_dumpall -U engineeri=
ng --column-inserts --attribute-inserts  > /tmp/$numdate# recor=
d in the log it was doneecho $(date) PID $$ backup completed >> /=
var/log/messages#ftp the fileftp -inv 192.168.100.29<<ENDFTP<=
br>user backupftp passwordcd ./backupLinus/lcd /tmpput $numdate=
byeENDFTP<font face=3D"Default Sans Serif,Verdana,Arial,Hel=
vetica,sans-serif" size=3D"2"><font face=3D"Default Sans Serif,Verdan=
a,Arial,Helvetica,sans-serif" size=3D"2">*** *** *** ***&nbs=
p;*** *** *** *** *** *** *** *** *=
** *** *** *** *** *** *** ***#instr=
uctions for making the .pgpass filetouch ~/.pgpasschmod 0600 ~/=
.pgpassecho '*:*:*:username:password' > ~/.pgpassNote that this =
presumes you are logged in as the user who will be dumping the database(s).=
"This e-mail messa=
ge and any attachment(s) are for the sole use of the intended recipient(s) =
and may contain company proprietary, privileged or confidential information=
.   If you are not the intended recipient(s), please contact the sender by =
reply e-mail, advise them of the error and destroy this message and its att=
achments as well as any copies. The review, use or distribution of this mes=
sage or its content by anyone other than the intended recipient or senior m=
anagement of the company is strictly prohibited."
On 01/21/11 11:07 AM, MargaretGillon@chromalloy.com wrote:
> After a year I have restarted work on a project using Postgresql. The
> database I created was in Postgresql 8.2.5. I updated my database
> server from Ubuntu 7.10 to 10.4 (lucid)  and installed Postgresql
> 9.0.2 The Postgresql install went fine and the restore from my
> previous pg_dumpall went fine but I have an issue with the backup script.
>
> I have made the pgpass file as root but I cannot get the backup script
> to run as root I must change to a postgresql/ubuntu user engineering
> and then the script runs. Previously the backup script ran from
> cron.daily . I need to know what I am not doing correctly for this to
> work. I do not have much scripting experience.
...
> FATAL:  Ident authentication failed for user "engineering"

that says it right there.  your LOCAL authentication type is set to
IDENT in your pg_hba.conf file.

see the documentation section on Client Authentication,
http://www.postgresql.org/docs/current/static/client-authentication.html




Re: pg_dumpall backup script w. ftp ; pgpass file ; after upgrade to Ubuntu 10.4 (lucid) and Postgresql 9.0.2

От
MargaretGillon@chromalloy.com
Дата:
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2>>> FATAL:  Ident authentication fa=
iled for user "engineering">>that says&nb=
sp;it right there.  your LOCAL authentication=
 type is set to >IDENT in your&nb=
sp;pg_hba.conf file.>That was it. I have updated my ins=
tall documentation. Thank you, Margaret "Thi=
s e-mail message and any attachment(s) are for the sole use of the intended=
 recipient(s) and may contain company proprietary, privileged or confidenti=
al information.   If you are not the intended recipient(s), please contact =
the sender by reply e-mail, advise them of the error and destroy this messa=
ge and its attachments as well as any copies. The review, use or distributi=
on of this message or its content by anyone other than the intended recipie=
nt or senior management of the company is strictly prohibited."