Re: CRON Jobs and Backups

From: Philip Hallstrom <postgresql(at)philip(dot)pjkh(dot)com>
To: operationsengineer1(at)yahoo(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-06 17:49:19
Message-ID: 20050606104738.S5184@wolf.pjkh.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2005-06-06 18:31:08 Re: [despammed] CRON Jobs and Backups
Previous Message operationsengineer1 2005-06-06 17:07:39 CRON Jobs and Backups