Re: Locking Tables & Backup Inquiry

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Locking Tables & Backup Inquiry
Date: 2011-12-14 18:38:19
Message-ID: 4EE8ED1B.6000608@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/14/2011 12:26 PM, Carlos Mennens wrote:
> On Wed, Dec 14, 2011 at 1:15 PM, Andy Colson<andy(at)squeakycode(dot)net> wrote:
>> Yep, you simply cron a pg_dump. (dumpall if you want users/roles and all
>> databases). No locking needed.
>
> So how would one put this in cron if I wanted to run this everyday?
>
> 0 * * * * /usr/bin/pg_dumpall> pg_dumpall.$DATE.sql
>
> Will that work above assuming I wanted to run this every day at that
> specific time? I'm just guessing since I've never created a Crontab or
> messed with PG backups.
>

google is your friend.

this'll run every hour.
> 0 * * * * /usr/bin/pg_dumpall> pg_dumpall.$DATE.sql

try:
0 4 * * * /usr/bin/pg_dumpall> pg_dumpall.$DATE.sql

that'll run at 4am every day.

Watch the path's, who know's what directory is current:

0 4 * * * /usr/bin/pg_dumpall > /backup/pg_dumpall.$DATE.sql

-Andy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Mennens 2011-12-14 18:54:20 Re: Locking Tables & Backup Inquiry
Previous Message Carlos Mennens 2011-12-14 18:26:12 Re: Locking Tables & Backup Inquiry