/usr/local/bin/pg_archivecleanup
pg_archivecleanup is designed to be used as an archive_cleanup_command to clean up WAL file archives when running as a standby server. pg_archivecleanup can also be used as a standalone program to clean WAL file archives.