Re: pg_start/stop_backup non-exclusive scripts to snapshot

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: hvjunk <hvjunk(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_start/stop_backup non-exclusive scripts to snapshot
Date: 2017-07-05 14:14:12
Message-ID: 20170705141412.GE1769@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

* Melvin Davidson (melvin6925(at)gmail(dot)com) wrote:
> Stephen,
> >This script is a good example of why trying to take a PG backup using
> shell scripts isn't a good idea.
>
> Your criticism is noted, however, I have used it many times in the past
> with absolutely no problem. I submitted that script as a possible solution
> to the op's problem/question. If you have an alternate solution or can make
> improvements to it, then I am sure the op and I would welcome them.

Part of my concern is that such a script is unlikely to show any
problems until it comes time to do a restore- it could be failing now
due to the issues I noted previously without any obvious error being
thrown but with the resulting backup not being viable. Hopefully that
isn't the case and ideally you're performing test restores of each
backup you take to ensure that it works.

Further, it doesn't address the OP's question, which was specifically
how to avoid using the now-deprecated exclusive backup method that the
script you posted uses.

* Michael Paquier (michael(dot)paquier(at)gmail(dot)com) wrote:
> On Wed, Jul 5, 2017 at 10:47 PM, Melvin Davidson <melvin6925(at)gmail(dot)com> wrote:
> > Your criticism is noted, however, I have used it many times in the past with absolutely no problem.
>
> Plug off the server on which is stored the backup just after your
> script finishes, you have a good chance to be surprised if you try to
> restore from this backup later on.

What might be worse would be to pull the plug while the backup is
running and then try to bring the primary back online. :/ That issue is
part of why the API used in this script is now deprecated.

> > I submitted that script as a possible solution
> > to the op's problem/question. If you have an alternate solution or can make improvements to it, then I am sure the op and I would welcome them.
>
> Stephen has mentioned two of them, with hundreds of man hours spent in
> developing those backup tools to be robust solutions, done by
> specialists on the matter.

Right, there's little sense in trying to perfect a shell script when
proper solutions exist.

Thanks!

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2017-07-05 14:29:22 Re: Feature proposal, DBURL: psql pgsql://joe:p4zzw0rd@example.org:2345/dbname
Previous Message Chris Travers 2017-07-05 14:09:21 Re: Strange case of database bloat