pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Automate pg_basebackup in linux
Date: Mon, 7 Jun 2021 11:56:34 -0400
Message-ID: <20210607155634.GM20766@tamriel.snowman.net> (raw)
In-Reply-To: <345839be-63ea-5a68-da74-4121cfddbf88@gmail.com>
References: <CACvDJ+-83LwuC1bC2dJ9062Y3MMtMm0z0fNrnN_kwm7enPHMwg@mail.gmail.com>
	<345839be-63ea-5a68-da74-4121cfddbf88@gmail.com>

Greetings,

* Ron (ronljohnsonjr@gmail.com) wrote:
> On 6/5/21 12:14 PM, SMAX Inbound wrote:
> >is there any script to automate pg_basebackup in linux using cron job..
> >i.e. shell script that will automate taking basebackup weekly, and
> >removing previous backup and wal files once base backup is successfully
> >completed...
> >
> 
> If you know any shell scripting languages, such a script is easy to write. 
> (Are you saying that you don't know "shell"?)

Writing a script that actually does everything correct is actually
really hard, unfortunately.  I know, I tried (and using perl too, not
just unix shell...).  Leveraging pg_basebackup makes it a bit easier as
that'll do things like properly fsync'ing the files but it doesn't do
anything for really managing WAL.

Definitely strongly recommend using existing tools which have been
developed for PostgreSQL and which handle expiration of backups and WAL.

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (7+ messages)  latest in thread

Message-ID: <20210607155634.GM20766@tamriel.snowman.net>
Permalink:  ../20210607155634.GM20766@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20210607155634.GM20766@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: sfrost@snowman.net, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Automate pg_basebackup in linux
  In-Reply-To: <20210607155634.GM20766@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox