Is there a way to specify files by age or date instead of by a hardcoded name to cleanup the WAL archives with the pg_archivecleanup command ?
For example, using the following command is pretty straightforward:
pg_archivecleanup "C:\Program Files\PostgreSQL\9.2\data\pg_xlog" 000000010000004600000045
where 000000010000004600000045 is the file name, and any file created before will be deleted.
However, if I want to automate the process, there must be a way to choose the files by age/date.