From 83aca89f7c3f913d960e2ea2d4d93b7d8e7a691d Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 10 Mar 2015 22:33:23 -0400 Subject: Move pg_archivecleanup from contrib/ to src/bin/ Reviewed-by: Michael Paquier --- doc/src/sgml/contrib.sgml | 1 - doc/src/sgml/filelist.sgml | 1 - doc/src/sgml/pgarchivecleanup.sgml | 211 --------------------------------- doc/src/sgml/ref/allfiles.sgml | 1 + doc/src/sgml/ref/pgarchivecleanup.sgml | 203 +++++++++++++++++++++++++++++++ doc/src/sgml/reference.sgml | 1 + 6 files changed, 205 insertions(+), 213 deletions(-) delete mode 100644 doc/src/sgml/pgarchivecleanup.sgml create mode 100644 doc/src/sgml/ref/pgarchivecleanup.sgml (limited to 'doc/src') diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml index a698d0fb2f8..f21fa149182 100644 --- a/doc/src/sgml/contrib.sgml +++ b/doc/src/sgml/contrib.sgml @@ -202,7 +202,6 @@ pages. part of the core PostgreSQL distribution. - &pgarchivecleanup; &pgstandby; &pgtestfsync; &pgtesttiming; diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml index 89fff7739e1..8b9d6a91279 100644 --- a/doc/src/sgml/filelist.sgml +++ b/doc/src/sgml/filelist.sgml @@ -126,7 +126,6 @@ - diff --git a/doc/src/sgml/pgarchivecleanup.sgml b/doc/src/sgml/pgarchivecleanup.sgml deleted file mode 100644 index fdf0cbb9d1b..00000000000 --- a/doc/src/sgml/pgarchivecleanup.sgml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - pg_archivecleanup - - - - pg_archivecleanup - 1 - Application - - - - pg_archivecleanup - clean up PostgreSQL WAL archive files - - - - - pg_archivecleanup - option - archivelocation - oldestkeptwalfile - - - - - Description - - - pg_archivecleanup is designed to be used as an - archive_cleanup_command to clean up WAL file archives when - running as a standby server (see ). - pg_archivecleanup can also be used as a standalone program to - clean WAL file archives. - - - - To configure a standby - server to use pg_archivecleanup, put this into its - recovery.conf configuration file: - -archive_cleanup_command = 'pg_archivecleanup archivelocation %r' - - where archivelocation is the directory from which WAL segment - files should be removed. - - - When used within , all WAL files - logically preceding the value of the %r argument will be removed - from archivelocation. This minimizes the number of files - that need to be retained, while preserving crash-restart capability. Use of - this parameter is appropriate if the archivelocation is a - transient staging area for this particular standby server, but - not when the archivelocation is intended as a - long-term WAL archive area, or when multiple standby servers are recovering - from the same archive location. - - - When used as a standalone program all WAL files logically preceding the - oldestkeptwalfile will be removed from archivelocation. - In this mode, if you specify a .backup file name, then only the file prefix - will be used as the oldestkeptwalfile. This allows you to remove - all WAL files archived prior to a specific base backup without error. - For example, the following example will remove all files older than - WAL file name 000000010000003700000010: - -pg_archivecleanup -d archive 000000010000003700000010.00000020.backup - -pg_archivecleanup: keep WAL file "archive/000000010000003700000010" and later -pg_archivecleanup: removing file "archive/00000001000000370000000F" -pg_archivecleanup: removing file "archive/00000001000000370000000E" - - - - pg_archivecleanup assumes that - archivelocation is a directory readable and writable by the - server-owning user. - - - - - Options - - - pg_archivecleanup accepts the following command-line arguments: - - - - - - - - Print lots of debug logging output on stderr. - - - - - - - - - Print the names of the files that would have been removed on stdout (performs a dry run). - - - - - - - - - - Print the pg_archivecleanup version and exit. - - - - - - extension - - - When using the program as a standalone utility, provide an extension - that will be stripped from all file names before deciding if they - should be deleted. This is typically useful for cleaning up archives - that have been compressed during storage, and therefore have had an - extension added by the compression program. For example: -x - .gz. - - - - Note that the - .backup file name passed to the program should not - include the extension. - - - - - - - - - - Show help about pg_archivecleanup command line - arguments, and exit. - - - - - - - - - Notes - - - pg_archivecleanup is designed to work with - PostgreSQL 8.0 and later when used as a standalone utility, - or with PostgreSQL 9.0 and later when used as an - archive cleanup command. - - - - pg_archivecleanup is written in C and has an - easy-to-modify source code, with specifically designated sections to modify - for your own needs - - - - - Examples - - On Linux or Unix systems, you might use: - -archive_cleanup_command = 'pg_archivecleanup -d /mnt/standby/archive %r 2>>cleanup.log' - - where the archive directory is physically located on the standby server, - so that the archive_command is accessing it across NFS, - but the files are local to the standby. - This will: - - - - - produce debugging output in cleanup.log - - - - - remove no-longer-needed files from the archive directory - - - - - - - Author - - - Simon Riggs simon@2ndquadrant.com - - - - - See Also - - - - - - diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml index 5b4692fb6d8..f3b577119bd 100644 --- a/doc/src/sgml/ref/allfiles.sgml +++ b/doc/src/sgml/ref/allfiles.sgml @@ -179,6 +179,7 @@ Complete list of usable sgml source files in this directory. + diff --git a/doc/src/sgml/ref/pgarchivecleanup.sgml b/doc/src/sgml/ref/pgarchivecleanup.sgml new file mode 100644 index 00000000000..779159d7fc2 --- /dev/null +++ b/doc/src/sgml/ref/pgarchivecleanup.sgml @@ -0,0 +1,203 @@ + + + + + pg_archivecleanup + + + + pg_archivecleanup + 1 + Application + + + + pg_archivecleanup + clean up PostgreSQL WAL archive files + + + + + pg_archivecleanup + option + archivelocation + oldestkeptwalfile + + + + + Description + + + pg_archivecleanup is designed to be used as an + archive_cleanup_command to clean up WAL file archives when + running as a standby server (see ). + pg_archivecleanup can also be used as a standalone program to + clean WAL file archives. + + + + To configure a standby + server to use pg_archivecleanup, put this into its + recovery.conf configuration file: + +archive_cleanup_command = 'pg_archivecleanup archivelocation %r' + + where archivelocation is the directory from which WAL segment + files should be removed. + + + When used within , all WAL files + logically preceding the value of the %r argument will be removed + from archivelocation. This minimizes the number of files + that need to be retained, while preserving crash-restart capability. Use of + this parameter is appropriate if the archivelocation is a + transient staging area for this particular standby server, but + not when the archivelocation is intended as a + long-term WAL archive area, or when multiple standby servers are recovering + from the same archive location. + + + When used as a standalone program all WAL files logically preceding the + oldestkeptwalfile will be removed from archivelocation. + In this mode, if you specify a .backup file name, then only the file prefix + will be used as the oldestkeptwalfile. This allows you to remove + all WAL files archived prior to a specific base backup without error. + For example, the following example will remove all files older than + WAL file name 000000010000003700000010: + +pg_archivecleanup -d archive 000000010000003700000010.00000020.backup + +pg_archivecleanup: keep WAL file "archive/000000010000003700000010" and later +pg_archivecleanup: removing file "archive/00000001000000370000000F" +pg_archivecleanup: removing file "archive/00000001000000370000000E" + + + + pg_archivecleanup assumes that + archivelocation is a directory readable and writable by the + server-owning user. + + + + + Options + + + pg_archivecleanup accepts the following command-line arguments: + + + + + + + + Print lots of debug logging output on stderr. + + + + + + + + + Print the names of the files that would have been removed on stdout (performs a dry run). + + + + + + + + + + Print the pg_archivecleanup version and exit. + + + + + + extension + + + When using the program as a standalone utility, provide an extension + that will be stripped from all file names before deciding if they + should be deleted. This is typically useful for cleaning up archives + that have been compressed during storage, and therefore have had an + extension added by the compression program. For example: -x + .gz. + + + + Note that the + .backup file name passed to the program should not + include the extension. + + + + + + + + + + Show help about pg_archivecleanup command line + arguments, and exit. + + + + + + + + + Notes + + + pg_archivecleanup is designed to work with + PostgreSQL 8.0 and later when used as a standalone utility, + or with PostgreSQL 9.0 and later when used as an + archive cleanup command. + + + + pg_archivecleanup is written in C and has an + easy-to-modify source code, with specifically designated sections to modify + for your own needs + + + + + Examples + + On Linux or Unix systems, you might use: + +archive_cleanup_command = 'pg_archivecleanup -d /mnt/standby/archive %r 2>>cleanup.log' + + where the archive directory is physically located on the standby server, + so that the archive_command is accessing it across NFS, + but the files are local to the standby. + This will: + + + + + produce debugging output in cleanup.log + + + + + remove no-longer-needed files from the archive directory + + + + + + + See Also + + + + + + diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml index 65ad795afe9..9fb32f8c284 100644 --- a/doc/src/sgml/reference.sgml +++ b/doc/src/sgml/reference.sgml @@ -257,6 +257,7 @@ &initdb; + &pgarchivecleanup; &pgControldata; &pgCtl; &pgResetxlog; -- cgit v1.2.3