Skip site navigation (1) Skip section navigation (2)

Re: vacuum and database backup

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Bolotov Pavel" <bpavel(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: vacuum and database backup
Date: 2007-08-21 21:44:27
Message-ID: dcc563d10708211444j7f83977bv64df6677021dc4dd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
On 8/21/07, Bolotov Pavel <bpavel(at)yahoo(dot)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:dbname:postgres:password

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

In response to

pgsql-admin by date

Next:From: Chris BrowneDate: 2007-08-21 22:08:13
Subject: Re: ROI on 7.2 to 8.2
Previous:From: Andrzej ZawadzkiDate: 2007-08-21 21:41:13
Subject: Re: cpu usage on the linux machine

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group