Re: Automated backup

From: "Ken Godee" <ken(at)perfect-image(dot)com>
To: "Robert Fitzpatrick" <robert(at)webtent(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Automated backup
Date: 2003-02-26 17:09:12
Message-ID: 3E5C9248.2774.51B544@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-26 17:09:30 Re: Automated backup
Previous Message Darko Prenosil 2003-02-26 17:08:16 Re: Function example