omniti-labs/omnipitr

how to delete wal files after recovery

Closed this issue · 2 comments

I am not using stream replication.
Postgres version : 9.5

I have a folder called master_wal_archive which is on the slave instance. It holds all the WAL files sent via rsync from the master.

This is the recovery command in the recovery.conf

restore_command='/var/lib/postgresql/omnipitr-1.3.3/bin/omnipitr-restore -l /var/log/omnipitr/restore.log -s /var/lib/postgresql/master_wal_archive/ %f %p'

My question is as time goes by the WAL files on the slave instance piles up. How do I reduce the WAL files that are successfully used to catch the standby instance?

Add omnipitr-cleanup call to recovery.conf in archive_cleanup_command parameter. Details in doc for omnipitr-cleanup.