[GENERAL] pg_start/stop_backup non-exclusive scripts to snapshot - Mailing list pgsql-general

From hvjunk
Subject [GENERAL] pg_start/stop_backup non-exclusive scripts to snapshot
Date
Msg-id E8A5F096-3D0F-41D5-8356-81C9FB3C3EE7@gmail.com
Whole thread Raw
Responses Re: [GENERAL] pg_start/stop_backup non-exclusive scripts to snapshot  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
Hi there,

 I’ve previously done ZFS snapshot backups like this:

psql -c “select pg_start_backup(‘snapshot’);”
zfs snapshot TANK/postgresql@`date ‘+%Ymd’`
psql -c “select * from  pg_stop_backup();”

Reading the PostgreSQL9.6 documentation, the advice/future is to use the non-exclusive method, where I’ll need to keep
asession *open* while the snapshot takes place, and after that I’ll have to issue the pg_stop_backup(false); in that
activeconnection that issued the pg_start_backup(‘backup’,false,false); 

How is this done inside a shell script?
Especially how to do error checking from the commands as psql -c “select pg_start_backup{‘test’,false,false);” not
goingto work? 

Hendrik

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [SPAM] Re: [GENERAL] Invalid field size
Next
From: "Daniel Verite"
Date:
Subject: Re: [GENERAL] Invalid field size