Re: CRON Jobs and Backups - Mailing list pgsql-novice

From Philip Hallstrom
Subject Re: CRON Jobs and Backups
Date
Msg-id 20050606104738.S5184@wolf.pjkh.com
Whole thread Raw
In response to CRON Jobs and Backups  (<operationsengineer1@yahoo.com>)
List pgsql-novice
> hi all,
>
> i've googled and searche dmy pgsql books and i can't
> quite get a confident grasp on cron jobs.
>
> 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
>
> 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?
>
> eg, PGUSER=postgres PGPASSWORD=password export...

Don't know about that... read up on /bin/sh to see how it handles things
like that.

If cpanel let's you upload files, you could put all of the above in a
'backup-pgsql.sh" file on your server then in your cron job put:

/bin/sh backup-pgsql.sh

> will databasename.bak.gz be stored in the same file as
> my database?

probably not.  If I were you, I'd put the full path of where you want the
file to be stored.

> how can i store the file on my local computer?

Mail it to yourself, or download it via FTP/HTTP...

-philip

pgsql-novice by date:

Previous
From:
Date:
Subject: CRON Jobs and Backups
Next
From: Andreas Kretschmer
Date:
Subject: Re: [despammed] CRON Jobs and Backups