Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5D80E1337B84 for ; Wed, 26 Jan 2011 20:11:35 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 40642-03 for ; Thu, 27 Jan 2011 00:11:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id 3B7581337B8B for ; Wed, 26 Jan 2011 20:11:24 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id 7A915124; Wed, 26 Jan 2011 19:11:18 -0500 (EST) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TH8iVO6B9vzI; Wed, 26 Jan 2011 19:11:17 -0500 (EST) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id 928F22D; Wed, 26 Jan 2011 19:11:17 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 55422AE54E; Thu, 27 Jan 2011 08:11:16 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id o85S5S2uGFLh; Thu, 27 Jan 2011 08:11:11 +0800 (WST) Received: from [10.1.1.5] (124-169-55-222.dyn.iinet.net.au [124.169.55.222]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id AFD80AE548; Thu, 27 Jan 2011 08:11:10 +0800 (WST) Message-ID: <4D40B81C.2030600@postnewspapers.com.au> Date: Thu, 27 Jan 2011 08:11:08 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: manuel antonio ochoa , postgres list Subject: Re: check files .backup References: <4D3E635D.9060309@postnewspapers.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/95 X-Sequence-Number: 35042 On 01/25/2011 11:14 PM, manuel antonio ochoa wrote: > I would like it complete and not truncated? That it hasn't been modified > since being > originally written? OK. First, check the exit code from pg_backup so you detect any failures. The exit code is reported by the shell on UNIX systems in the $? variable, but you can usually just do something like the following (untested): if ! pg_backup .... ; then logger -p crit "pg_backup failed" mail -s "Pg backup failed" someone@yourcompany <<__END__ The latest backup failed. Check the logs for why, and fix it! __END__ fi Second: after writing the backup, calculate an md5sum or (preferably) digitally sign the backup using gpg. An md5sum is only really protection against corruption unless you store it somewhere separate and secure. I prefer to digitally sign my backups with detached gpg signatures. -- Craig Ringer