pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
check files .backup
4+ messages / 3 participants
[nested] [flat]

* check files .backup
@ 2011-01-25 00:18 manuel antonio ochoa <manuel8aalfaro@gmail.com>
  2011-01-25 05:45 ` Re: check files .backup Craig Ringer <craig@postnewspapers.com.au>
  2011-01-25 07:10 ` Re: check files .backup Scott Marlowe <scott.marlowe@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: manuel antonio ochoa @ 2011-01-25 00:18 UTC (permalink / raw)
  To: pgsql-sql

Do you know if exist a  function to check my file.backup created by pgdump.
?

thnks

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: check files .backup
  2011-01-25 00:18 check files .backup manuel antonio ochoa <manuel8aalfaro@gmail.com>
@ 2011-01-25 05:45 ` Craig Ringer <craig@postnewspapers.com.au>
  2011-01-27 00:11   ` Re: check files .backup Craig Ringer <craig@postnewspapers.com.au>
  1 sibling, 1 reply; 4+ messages in thread

From: Craig Ringer @ 2011-01-25 05:45 UTC (permalink / raw)
  To: manuel antonio ochoa <manuel8aalfaro@gmail.com>; +Cc: pgsql-sql

On 25/01/11 08:18, manuel antonio ochoa wrote:
> Do you know if exist a  function to check my file.backup created by
> pgdump. ?

What do you want to check? That it restores correctly? That it's
complete and not truncated? That it hasn't been modified since being
originally written? That it matches the data currently in the database?
What?

-- 
System & Network Administrator
POST Newspapers



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: check files .backup
  2011-01-25 00:18 check files .backup manuel antonio ochoa <manuel8aalfaro@gmail.com>
  2011-01-25 05:45 ` Re: check files .backup Craig Ringer <craig@postnewspapers.com.au>
@ 2011-01-27 00:11   ` Craig Ringer <craig@postnewspapers.com.au>
  0 siblings, 0 replies; 4+ messages in thread

From: Craig Ringer @ 2011-01-27 00:11 UTC (permalink / raw)
  To: manuel antonio ochoa <manuel8aalfaro@gmail.com>; 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: check files .backup
  2011-01-25 00:18 check files .backup manuel antonio ochoa <manuel8aalfaro@gmail.com>
@ 2011-01-25 07:10 ` Scott Marlowe <scott.marlowe@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Scott Marlowe @ 2011-01-25 07:10 UTC (permalink / raw)
  To: manuel antonio ochoa <manuel8aalfaro@gmail.com>; +Cc: pgsql-sql

On Mon, Jan 24, 2011 at 5:18 PM, manuel antonio ochoa
<manuel8aalfaro@gmail.com> wrote:
> Do you know if exist a  function to check my file.backup created by pgdump.

I run backups like this in bash:

if (pg_dump yadayada); then
    echo "backup succeeded."
else
    echo "backup failed."
fi;

in a cronjob set to email me.  Then when it fails or not, I see it
right there in my nightly email.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-01-27 00:11 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 00:18 check files .backup manuel antonio ochoa <manuel8aalfaro@gmail.com>
2011-01-25 05:45 ` Craig Ringer <craig@postnewspapers.com.au>
2011-01-27 00:11   ` Craig Ringer <craig@postnewspapers.com.au>
2011-01-25 07:10 ` Scott Marlowe <scott.marlowe@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox