From: | Stephen Frost <sfrost(at)snowman(dot)net> |
---|---|
To: | mariusz <marius(at)mtvk(dot)pl> |
Cc: | hvjunk <hvjunk(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: pg_start/stop_backup non-exclusive scripts to snapshot |
Date: | 2017-07-10 22:59:27 |
Message-ID: | 20170710225927.GQ1769@tamriel.snowman.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Greetings,
* mariusz (marius(at)mtvk(dot)pl) wrote:
> On Tue, 2017-07-04 at 17:55 -0400, Stephen Frost wrote:
> > > How is this done inside a shell script?
> >
> > Generally, it's not. I suppose it might be possible to use '\!' with
> > psql and then have a shell snippet that looks for some file that's
> > touched when the snapshot has finished, but really, trying to perform a
> > PG backup using hacked together shell scripts isn't recommended and
> > tends to have problems.
>
> not saying to use scripts or pg tools, but if OP needs a script, may
> consider perl module IPC::Run instead of shell script - easy to use
> interacting with subprocesses over filehandles or pipes (even supports
> ptys). that way you can keep your active psql session, pass input to it,
> view and process it's output, while doesn't block you from doing other
> things meanwhile
>
> of course it's perl, not shell, but looks "scripty" and can do what OP
> wants
Sure, that's more-or-less what pgBackRest does (which is Perl, mostly).
Thanks!
Stephen
From | Date | Subject | |
---|---|---|---|
Next Message | rihad | 2017-07-11 05:10:41 | Re: Changing collate & ctype for an existing database |
Previous Message | Lele Gaifax | 2017-07-10 21:52:55 | Registering aggregate function for a custom domain |