how to delete wal files after recovery
Closed this issue · 2 comments
simkimsia commented
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?
Deleted user commented
Add omnipitr-cleanup call to recovery.conf in archive_cleanup_command parameter. Details in doc for omnipitr-cleanup.
simkimsia commented
Thanks @depesz awesome code by the way.
Note to self: https://github.com/omniti-labs/omnipitr/blob/v1.3.3/doc/omnipitr-cleanup.pod#description