Re: Using cp to back up a database?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Using cp to back up a database?
Date: 2017-10-09 14:15:15
Message-ID: 1f73e7e9-e41b-2e7e-d705-f0f6b71de52d@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Sure I want a consistent database.  Why doesn't?

But log shipping requires you to rsync/var/lib/pgsql/data to the remote
server, and that's consistent, so why wouldn't rsync to a local directory
also be consistent?

On 10/09/2017 08:51 AM, Larry Rosenman wrote:
>
> If you want a consistent database (you **REALLY** do), pg_dump is the
> correct tool.
>
> --
>
> Larry Rosenman http://www.lerctr.org/~ler <http://www.lerctr.org/%7Eler>
>
> Phone: +1 214-642-9640                 E-Mail: ler(at)lerctr(dot)org
> <mailto:ler(at)lerctr(dot)org>
>
> US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106
>
> *From: *<pgsql-general-owner(at)postgresql(dot)org> on behalf of Ron Johnson
> <ron(dot)l(dot)johnson(at)cox(dot)net>
> *Date: *Monday, October 9, 2017 at 8:41 AM
> *To: *"pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
> *Subject: *[GENERAL] Using cp to back up a database?
>
> Hi,
>
> v8.4.20
>
> This is what the current backup script uses:
>
> /usr/bin/psql -U postgres -c "SELECT
> pg_start_backup('Incrementalbackup',true);"
>
> cp -r /var/lib/pgsql/data/* $dumpdir/data/
>
> /usr/bin/psql -U postgres template1 -c "SELECT pg_stop_backup();"
>
>
>
> Should it use rsync or pg_dump instead?
>
> Thanks
>

--
World Peace Through Nuclear Pacification

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2017-10-09 14:20:36 Re: Using cp to back up a database?
Previous Message Michael Paquier 2017-10-09 14:13:36 Re: Using cp to back up a database?