| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | operationsengineer1(at)yahoo(dot)com |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: CRON Jobs and Backups |
| Date: | 2005-06-07 04:43:27 |
| Message-ID: | 25900.1118119407@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
<operationsengineer1(at)yahoo(dot)com> writes:
> as i understand it... the following should enable me
> to backup via cron:
> PGUSER=postgres
> PGPASSWORD=password
> export PGUSER PGPASSWORD
> pg_dump databasename | gzip > databasename.bak.gz
This is probably a pretty bad way to handle the password --- on many
Unix variants, anyone can see the list of environment variables that is
passed down to the pg_dump process. It'd be far safer to put the
password in a ~/.pgpass file owned by the Unix user that runs the cron
job.
> my interfaces is cpanel and it only gives me one line
> to type this in... can i replace the returns with a
> space and will this still work?
Get a better user interface ;-). Or put the whole mess in a script file
and invoke the script file from your cron job.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Aarni Ruuhimäki | 2005-06-07 07:52:09 | Re: CRON Jobs and Backups |
| Previous Message | Andreas Kretschmer | 2005-06-06 18:31:08 | Re: [despammed] CRON Jobs and Backups |