OS Manuals

/usr/lib/postgresql/18/bin/pg_archivecleanup

spilo-4 compat package

From spilo-4-compat 4.1.2-r26 (enterprise-packages), captured 2026-11-08 by running pg_archivecleanup --help (exit 0). permalink

pg_archivecleanup removes older WAL files from PostgreSQL archives.

Usage:
  pg_archivecleanup [OPTION]... ARCHIVELOCATION OLDESTKEPTWALFILE

Options:
  -b, --clean-backup-history  clean up files including backup history files
  -d, --debug                 generate debug output (verbose mode)
  -n, --dry-run               dry run, show the names of the files that would be
                              removed
  -V, --version               output version information, then exit
  -x, --strip-extension=EXT   strip this extension before identifying files for
                              clean up
  -?, --help                  show this help, then exit

For use as "archive_cleanup_command" in postgresql.conf:
  archive_cleanup_command = 'pg_archivecleanup [OPTION]... ARCHIVELOCATION %r'
e.g.
  archive_cleanup_command = 'pg_archivecleanup /mnt/server/archiverdir %r'

Or for use as a standalone archive cleaner:
e.g.
  pg_archivecleanup /mnt/server/archiverdir 000000010000000000000010.00000020.backup

Report bugs to <pgsql-bugs@lists.postgresql.org>.
PostgreSQL home page: <https://www.postgresql.org/>
Options (6)
OptionDescriptionSource
-b, --clean-backup-historyclean up files including backup history fileshelp
-d, --debuggenerate debug output (verbose mode)help
-n, --dry-rundry run, show the names of the files that would be removedhelp
-V, --versionoutput version information, then exithelp
-x, --strip-extension EXTstrip this extension before identifying files for clean uphelp
-?, --helpshow this help, then exithelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.