Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B6F64632414 for ; Thu, 15 Apr 2010 13:02:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 86489-07 for ; Thu, 15 Apr 2010 16:01:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id B6418632349 for ; Thu, 15 Apr 2010 13:01:59 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 15 Apr 2010 11:01:58 -0500 Message-Id: <4BC6F21D0200002500030956@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 15 Apr 2010 11:01:49 -0500 From: "Kevin Grittner" To: "Renato Oliveira" , "pgsql-admin@postgresql.org" Subject: Re: archived WALL files question References: <7965A9DCF12CC14984420BCC37B1608F25AC0B99AD@Elzar.grant.co.uk> In-Reply-To: <7965A9DCF12CC14984420BCC37B1608F25AC0B99AD@Elzar.grant.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.074 tagged_above=-10 required=5 tests=AWL=-0.164, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/194 X-Sequence-Number: 34288 Renato Oliveira wrote: > I was reading again the documentation... "The archive command > should generally de designed to refuse to overwrite any > pre-existing archive file." This means it will keep writing logs > to the folder specified forever, and without an intervention, the > media will run out of space. Overwriting an existing file wouldn't help with that, since the filenames keep changing. It might, for example, prevent accidentally wiping out the WAL files from one database cluster with WAL files from another by copying the postgresql.conf file and neglecting to change the archive script. > What do you guys do with regards to this situation, for example: > How to you clean up the old archived logs? We keep two weekly base backups and all the WAL files needed to recover from the earlier of the two to present. We also keep an archival copy of the first base backup of each month with just the WAL files needed to start it. We delete WAL files when no longer needed to support this retention policy. It's all pretty automatic based on bash scripts run from cron jobs. Of course, you'll want to tailor your strategy to your business needs. -Kevin