pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Bolotov Pavel <bpavel@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: vacuum and database backup
Date: Tue, 21 Aug 2007 16:44:27 -0500
Message-ID: <dcc563d10708211444j7f83977bv64df6677021dc4dd@mail.gmail.com> (raw)
In-Reply-To: <978733.49771.qm@web33502.mail.mud.yahoo.com>
References: <978733.49771.qm@web33502.mail.mud.yahoo.com>

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: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



view thread (2+ messages)

Message-ID: <dcc563d10708211444j7f83977bv64df6677021dc4dd@mail.gmail.com>
Permalink:  ../dcc563d10708211444j7f83977bv64df6677021dc4dd@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10708211444j7f83977bv64df6677021dc4dd@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott.marlowe@gmail.com, bpavel@yahoo.com
  Subject: Re: vacuum and database backup
  In-Reply-To: <dcc563d10708211444j7f83977bv64df6677021dc4dd@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox