How to Monitor backups

From: "Birchall, Austen" <austen(dot)birchall(at)metoffice(dot)gov(dot)uk>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: How to Monitor backups
Date: 2013-10-14 15:08:26
Message-ID: 4E154FB60786D74BB4DFDC97BF991CAC0C16F8@EXXCMPD1DAG2.cmpd1.metoffice.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi again

9.2.4 on RHEL 6

I have a backup that runs by cronjob every day which is basically this:

00 19 * * * /backup_scripts/locsng_backup.sh > /cron/locsng_backup.out 2>&1

View /backup_scripts/locsng_backup.sh:

# carry out schema only backup of the db database
/pg_dumpall -l db -U postgres -s > /backups/pg_db_schema_backups/db_ci_schema_dump$date_of_backup.sql 2>&1

# carry out backup of db database
/pg_dump -Fc db -U postgres > /backups/pg_db_db_backups/db_ci_backup$date_of_backup

# carry out cluster wide metadata backup
/pg_dumpall -g > /backups/pg_cluster_dump/cluster_ci_medadata$date_of_backup.sql

Is there a best practise way of how to monitor this sort of backup?

- my initial ideas are:

1. Check by cron if /cron/locsng_backup.out > 24 hours old (of course this will not work if cron fails) and if so notify the DBA by email?

2. As part of the script check if cron/locsng_backup.out > 0 bytes in size (of course this will not work if cron fails) and if so notify the DBA by email?

3. Does pg_dump, pg_dumpall return an error code if it is unsuccessful and can be trapped in same way and then used to notify the DBA by email?

Thanks in advance

Austen

Austen Birchall  Senior Database Administrator
Met Office

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Payal Singh 2013-10-14 15:19:21 Re: How to Monitor backups
Previous Message Miguel Beltran R. 2013-10-11 14:04:25 Re: Forms for entering data into postgresql