Re: check files .backup - Mailing list pgsql-sql

From Craig Ringer
Subject Re: check files .backup
Date
Msg-id 4D40B81C.2030600@postnewspapers.com.au
Whole thread Raw
In response to check files .backup  (manuel antonio ochoa <manuel8aalfaro@gmail.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: manuel antonio ochoa
Date:
Subject: Compare the resulta of a count sql into bash
Next
From: Josh Kupershmidt
Date:
Subject: Re: Compare the resulta of a count sql into bash