pg_archivecleanup
removes old WAL archive files no longer needed by standby servers
TLDR
Clean old WAL files
$ pg_archivecleanup [archive_dir] [oldest_kept_wal]
Dry run$ pg_archivecleanup -n [archive_dir] [oldest_kept_wal]
Clean with extension$ pg_archivecleanup -x .gz [archive_dir] [oldest_kept_wal]
SYNOPSIS
pg_archivecleanup [options] archivelocation oldestkeptwalfile
DESCRIPTION
pg_archivecleanup removes old WAL archive files no longer needed by standby servers. Typically used as archivecleanupcommand in recovery.conf. Maintains WAL archive size.
PARAMETERS
-d
Debug output.-n
Dry run (show what would be removed).-x extension
File extension for compressed files.
SEE ALSO
pg_basebackup(1), pg_receivewal(1)
