Docs for pg_archivecleanup
authorSimon Riggs
Mon, 14 Jun 2010 17:25:24 +0000 (17:25 +0000)
committerSimon Riggs
Mon, 14 Jun 2010 17:25:24 +0000 (17:25 +0000)
doc/src/sgml/contrib.sgml
doc/src/sgml/filelist.sgml
doc/src/sgml/pgarchivecleanup.sgml [new file with mode: 0644]

index 645783a1a63edb8a0ffeb732ad59839c9a6cc738..b801c4044353d7119bd34ad8a88bdbf44d7384f7 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  Additional Supplied Modules
@@ -101,6 +101,7 @@ psql -d dbname -f SHAREDIR/contrib/module.sql
  &oid2name;
  &pageinspect;
  &passwordcheck;
+ &pgarchivecleanup;
  &pgbench;
  &pgbuffercache;
  &pgcrypto;
index dc2044b77cf463d36d4a38edd51e4e29126e1d65..30b5fca72daa386bd25f110095f443c1de559f98 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
 
 
 
 
+
 
 
 
diff --git a/doc/src/sgml/pgarchivecleanup.sgml b/doc/src/sgml/pgarchivecleanup.sgml
new file mode 100644 (file)
index 0000000..7a839ba
--- /dev/null
@@ -0,0 +1,158 @@
+
+
+
pg_archivecleanup
+
+  pg_archivecleanup
+
+  pg_archivecleanup is designed to cleanup an archive when used
+  as an archive_cleanup_command when running with
+  standby_mode = onpg_archivecleanup can
+  also be used as a standalone program to clean WAL file archives.
+
+  pg_archivecleanup features include:
+  
+   
+    Written in C, so very portable and easy to install
+   
+  
+  
+   
+    Easy-to-modify source code, with specifically designated
+    sections to modify for your own needs
+   
+  
+
+  Usage
+
+  
+   To configure a standby
+   server to use pg_archivecleanup, put this into its
+   recovery.conf configuration file:
+  
+  
+archive_cleanup_command = 'pg_archivecleanup archiveDir %r'
+  
+  
+   where archiveDir is the directory from which WAL segment
+   files should be restored.
+  
+  
+   When used within archive_cleanup_command,
+   all WAL files logically preceding the value of the %r
+   will be removed 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.
+  
+  
+   The full syntax of pg_archivecleanup's command line is
+  
+  
+pg_archivecleanup  option ...  archivelocation restartwalfile
+  
+  
+   When used as a standalone program all WAL files logically preceding the 
+   restartwalfile will be removed archivelocation.
+   In this mode, if you specify a .backup filename, then only the file prefix
+   will be used as the restartwalfile. 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 filename 000000010000003700000010:
+  
+  
+pg_archivecleanup -d archive 000000010000003700000010.00000020.backup
+
+pg_archivecleanup:  keep WAL files 000000010000003700000010 and later
+pg_archivecleanup:  removing "archive/00000001000000370000000F"
+pg_archivecleanup:  removing "archive/00000001000000370000000E"
+  
+  
+   pg_archivecleanup assumes that
+   archivelocation is a directory readable and writable by the
+   server-owning user.
+  
+
+  <application>pg_archivecleanup</> Options
+
+   
+    pg_archivecleanup accepts the following command-line arguments:
+
+    
+
+     
+      
+      
+       
+        Print lots of debug logging output on stderr.
+       
+      
+     
+
+    
+   
+
+
+  Examples
+
+  On Linux or Unix systems, you might use:
+
+  
+archive_cleanup_command = 'pg_archivecleanup -d .../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 standby.log
+    
+   
+   
+    
+     remove no-longer-needed files from the archive directory
+    
+   
+  
+
+
+  Supported server versions
+
+  
+   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.
+  
+
+  Author
+
+  
+   Simon Riggs [email protected]
+  
+
+