Re: pg_basebackup --incremental

From: Serkan Akdemir <osmosyum(at)hotmail(dot)com>
To: Sam Stearns <sam(dot)stearns(at)dat(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>, Avi Vallarapu <av(at)hexacluster(dot)ai>, Henry Ashu <henry(dot)ashu(at)dat(dot)com>
Subject: Re: pg_basebackup --incremental
Date: 2025-10-31 10:28:00
Message-ID: 5E1A5137-37A3-4F83-880F-0C17DDA1F143@hotmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I created a script for incremental backup+merge on PostgreSQL 17+
It creates a full backup and later (next run) incremental backups. Incremental backups are merged to full backup with script, so you have always updated full backup.
Disclaimer: use it at your own risk.

Simple usage is:
# first backup should be full
pg_backup.sh --mode=fulll

# then inc
pg_backup.sh --mode=fincremental

<https://github.com/rdnkrkmz/medium-resources/blob/main/pg_backup.sh>
medium-resources/pg_backup.sh at main · rdnkrkmz/medium-resources<https://github.com/rdnkrkmz/medium-resources/blob/main/pg_backup.sh>
github.com<https://github.com/rdnkrkmz/medium-resources/blob/main/pg_backup.sh>
[apple-touch-icon-180x180-a80b8e11abe2.png]<https://github.com/rdnkrkmz/medium-resources/blob/main/pg_backup.sh>

On 28 Oct 2025, at 20:42, Sam Stearns <sam(dot)stearns(at)dat(dot)com> wrote:

Howdy,

We're running version 17.6. Would anyone be able to point me to, or provide, some sample use cases / scripts / usage to deploy a pg_basebackup full + --incremental strategy as a backup solution, please?

This will be used temporarily as we are migrating to RDS soon which is why we're not going with pgBackRest.

Thanks,

Sam

--

Samuel Stearns
Team Lead - Database
c: 971 762 6879 | o: 971 762 6879 | DAT.com

[https://lh7-rt.googleusercontent.com/docsz/AD_4nXchMTXZiU3P-OkN7UwPyrdxiCAOkHWIArmSrehhAl-cXaYxECakbMV5owUfMaMjAZZcbjttr8pEtSGrZjUSRNaxbLxumAthLgYlFE5iT2P2eOJu4jtqizp_fYM0Mq1DZyFUeHMhpGKjiGIzqD_ny_hPIzlt?key=z3dM0-Cr9WzKyLauPVBgWw]<https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sam Stearns 2025-10-31 14:25:34 Re: pg_basebackup --incremental
Previous Message Shardul Borhade 2025-10-31 09:50:02 Re: Question on pg_stat_io showing zero reads/writes for I/O workers