Re: vacuum and database backup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/21/07, Bolotov Pavel <bpavel@xxxxxxxxx> 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

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

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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux