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

From: MargaretGillon(at)chromalloy(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dumpall backup script w. ftp ; pgpass file ; after upgrade to Ubuntu 10.4 (lucid) and Postgresql 9.0.2
Date: 2011-01-21 19:07:34
Message-ID: OF3F8F2505.A295735A-ON8825781F.005A42C1-8825781F.00691067@LocalDomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>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)&nbsp; 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.<br><br>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. <br><br>The error message is <br>root(at)claLinus:/# source /etc/cron.daily/postgresql-backup.sh<br>pg_dumpall: could not connect to database "template1": FATAL:&nbsp; Ident authentication failed for user "engineering"<br><br><br><br>I have confirmed that .pgpass exists <br><br>root(at)claLinus:/# locate .pgpass<br>/home/engineering/.pgpass<br>/home/mmg/.pgpass<br>/root/.pgpass<br><br><font><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2">Below is my backup script and my instructions for creating the pgpass that came from this list several years ago<br><br></font></font>Thank you for any help.<br><div>Margaret <br><br><font><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2">***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***<br></font></font>#!/bin/bash<br>#file is /etc/cron.daily/postgresql-backup.sh<br>#store the file name into a variable<br>numdate=$(date +%F)-$(date +%k%M)owl.sql<br>#remove spaces from the file name<br>numdate=${numdate/ /}<br>#backup the database<br>pg_dumpall -U engineering --column-inserts --attribute-inserts&nbsp; &gt; /tmp/$numdate<br># record in the log it was done<br>echo $(date) PID $$ backup completed &gt;&gt; /var/log/messages<br>#ftp the file<br>ftp -inv 192.168.100.29&lt;&lt;ENDFTP<br>user backupftp password<br>cd ./backupLinus/<br>lcd /tmp<br>put $numdate<br>bye<br>ENDFTP<br><br><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><font><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2">***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***&nbsp;***<br>#instructions for making the .pgpass file<br><br>touch ~/.pgpass<br>chmod 0600 ~/.pgpass<br>echo '*:*:*:username:password' &gt; ~/.pgpass<br>Note that this presumes you are logged in as the user who will be dumping the database(s).<br><br></font></font></font><br></div></div></font>&quot;This e-mail message 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 attachments as well as any copies. The review, use or distribution of this message or its content by anyone other than the intended recipient or senior management of the company is strictly prohibited.&quot;<BR>

Attachment Content-Type Size
unknown_filename text/html 3.3 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2011-01-21 19:16:46 Re: pg_dumpall backup script w. ftp ; pgpass file ; after upgrade to Ubuntu 10.4 (lucid) and Postgresql 9.0.2
Previous Message Daniele Varrazzo 2011-01-21 18:48:43 Re: Constraint exclusion with box and integer