Unix Technical Forum

vacuum and database backup

This is a discussion on vacuum and database backup within the pgsql Admins forums, part of the PostgreSQL category; --> Hi How can i setup vacuum and database backup from crontab on ubuntu. The problem is that both programs ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 08:09 AM
Bolotov Pavel
 
Posts: n/a
Default vacuum and database backup

Hi

How can i setup vacuum and database backup
from crontab on ubuntu.
The problem is that both programs ask password.

Could you send an example script.

Thanks
Pavel.




__________________________________________________ __________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:09 AM
Scott Marlowe
 
Posts: n/a
Default Re: vacuum and database backup

On 8/21/07, Bolotov Pavel <bpavel@yahoo.com> wrote:
> Hi
>
> How can i setup vacuum and database backup
> from crontab on ubuntu.
> The problem is that both programs ask password.
>
> Could you send an example script.


All you need is a .pgpass file for the account running the backups.
(or trust for that account or identd if it's on the same machine)

Using .pgpass with a line like this:

dbmachinename:5432:dbnameostgresassword

in say, the postgres user's home directory, and set to 0600
permissions, pg_dump could backup the db named dbname on the machine
dbmachinename as the user postgres with the password password.

All that's left is cronning it up. You might have to set a home dir
in crontab at the top:

HOME=/home/postgres

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:03 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com