title: pg_archivecleanup and streaming replication
body: <p>Using postgres 9.3.</p>
  
  <p>I'm a bit confused on the proper usage of pg_archivecleanup.</p>
  
  <p>I'm using both streaming replication and backup with continuous archiving for PITR recovery.</p>
  
  <p>I don't think I can configure pg_archivecleanup in recovery.conf on the standby as it wouldn't achieve anything.  The master is not archiving to a location accessible to the standby.  The master is archiving to a location on its local disk, and then those archives and the associated backup are being rsync'd to a large backup disk.</p>
  
  <p>So, it seems the solution would be to run pg_archivecleanup in "standalone" mode on the master, such as:</p>
  
  <pre><code>/usr/lib/postgresql/9.3/bin/pg_archivecleanup -d /archive 0000000100000010000000F0.00000028.backup
  </code></pre>
  
  <p>So, I'd do a cron job that would run the pg_archivecleanup command for any .backup files which are older than the latest one, and then delete those backup files, leaving only the latest one.</p>
  
  <p>Is my understanding and plan correct?</p>