Re: check files .backup

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: manuel antonio ochoa <manuel8aalfaro(at)gmail(dot)com>, postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: check files .backup
Date: 2011-01-27 00:11:08
Message-ID: 4D40B81C.2030600@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Kupershmidt 2011-01-27 04:49:53 Re: Compare the resulta of a count sql into bash
Previous Message manuel antonio ochoa 2011-01-26 17:07:05 Compare the resulta of a count sql into bash