Incremental Backup Postgresql PITR

0

I have an incremental backup routine running daily saving Postgresql logs .

Every morning the full backup is performed:

pg_start_backup() tar -cvzf /usr/local/pgsql/pgDataPITR/pgdatabk.tar /usr/local/pgsql/pgDataPITR/ select pg_stop_backup();

I have a question regarding the deletion of Wallogs, at what point should I do this, before running the full backup, or after specifying a date for the deletion.

    
asked by anonymous 02.11.2016 / 15:01

1 answer

1

Answer by: Franklin Anderson de Oliveira Souza on Postgresql Brazil

You can perform the basebackup using the pg_basebackup tool, once done successfully it marks the last wal with the .backup extension. This means that the newer wals along with the basebackup generated by the pg_basebackup tool assures you a consistent restore. The old wals, that is, before the marked with .backup can be deleted, for this you can use the pg_archivecleanup tool that makes this service for you, read the documentation for more details or ask right here in the list!

I hope I have helped

    
04.11.2016 / 18:43