Re: Automated backup - Mailing list pgsql-general

From Ken Godee
Subject Re: Automated backup
Date
Msg-id 3E5C9248.2774.51B544@localhost
Whole thread Raw
In response to Automated backup  ("Robert Fitzpatrick" <robert@webtent.com>)
List pgsql-general
Not sure if I'm reading your email correctly,
but I use several bash scripts to import data daily.
Even thought the cron/scripts are owned and run by
root, root doesn't have permissions with postgres
so your script can use the "su -c" command as a user who
has permissions, ie.
su - user -c "pg_dumpall"
The "-c" switch will run just one command and return to
previous user.


> I have a script that tars up dirs for me each night and I've added a
> pg_dumpall function to the script, but having problem with
> authentication. I created a .pgpass file in the root user folder with
> the appropriate permissions (600). However, even though the script is
> owned by root, it does not run. I guess the .pgpass file is not loading
> unless root actually logs in. Can anyone shed light on the best way to
> get pg_dump to work unattended or point me in the right direction.
>
> --
> Robert
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>



pgsql-general by date:

Previous
From: Patrik Kudo
Date:
Subject: Re: index usage (and foreign keys/triggers)
Next
From: Tom Lane
Date:
Subject: Re: Automated backup