Backup Incremental Postgresql PITR

Asked

Viewed 277 times

0

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

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 doubt regarding the deletion of Wal logs, at what point should I do this, before running the full backup, or after specifying a date for the deletion.

1 answer

1


Answer by: Franklin Anderson de Oliveira Souza at Postgresql Brasil

You can perform basebackup using the pg_basebackup tool, once successfully it marks the last Wal with the .backup. This means that the newer Wals along with the basebackup generated by the pg_basebackup tool ensures you a consistent Restore. Old Wals, that is, previous to the one marked with . backup can be deleted, for this you can use the tool pg_archivecleanup that makes you this service, for more details read the documentation or ask here in the list !

I hope I’ve helped

Browser other questions tagged

You are not signed in. Login or sign up in order to post.