As I have very low wal_keep_segments compare to my wal generation, I am collecting archive wal files at slave. Now in order to clean up archive wal collection directory at slave, I used "archive_cleanup_command". I watched that after archive wal files were pilling up at slave and after certain point it was cleared up. But still I didn't get the idea when it will be executed and clean up my directory.
Example: recovery.conf that I used: standby_mode = 'on' # enables stand-by (readonly) mode primary_conninfo = 'host= 10.0.0.1 port= 5432 user= replicator password=replicator' trigger_file = '/pgdata/pgsql.trigger.5432' restore_command = 'cp /archivewal/%f %p' archive_cleanup_command = '$HOME/bin/pg_archivecleanup /archivewal %r' Any idea please. Thanks.