Re: Backup Database Question

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Backup Database Question
Date: 2011-10-06 19:12:37
Message-ID: 4E8DFDA5.3030506@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/06/11 8:26 AM, Carlos Mennens wrote:
> Yes I agree but I didn't know enough about PostgreSQL to make that
> determination. Seems very logical however. Does anyone know of a
> PostgreSQL backup script floating around the Internet for Linux
> systems? I found a great one for MySQL but sadly that doesn't do me
> any good.

/path/to/pg_dumpall | gzip > /path/to/pgbackup-$(date -I).sql.gz

put this in a script accessible by the postgres user, and in the
postgres user's crontab, invoke it something like..

30 1 * * * /path/to/backupscript

to run it every night at 1:30am. If you only want to run it once a week...

30 1 * * 6 /path/to/backupscript

which will run it on Saturday morning at 1:30am (day 6)

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Mennens 2011-10-06 19:18:47 Re: Backup Database Question
Previous Message Carlos Mennens 2011-10-06 18:31:59 Tuning Variables For PostgreSQL