<operationsengineer1@yahoo.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