Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pages/common/pg_archivecleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# pg_archivecleanup

> Remove old WAL archive files in PostgreSQL.
> More information: <https://www.postgresql.org/docs/current/pgarchivecleanup.html>.

- Clean an archive directory up to a given WAL file:

`pg_archivecleanup {{archivelocation}} {{oldestkeptwalfile}}`

- Perform a dry run (list files that would be removed):

`pg_archivecleanup {{[-n|--dry-run]}} {{archivelocation}} {{oldestkeptwalfile}}`

- Strip a file extension before deciding deletion (e.g., compressed files):

`pg_archivecleanup {{[-x|--strip-extension]}} {{extension}} {{archivelocation}} {{oldestkeptwalfile}}`

- Remove backup history files too (in addition to WAL):

`pg_archivecleanup {{[-b|--clean-backup-history]}} {{archivelocation}} {{oldestkeptwalfile}}`

- Enable debug logging output:

`pg_archivecleanup {{[-d|--debug]}} {{archivelocation}} {{oldestkeptwalfile}}`
Loading