| From: | Richard Huxton <dev(at)archonet(dot)com> |
|---|---|
| To: | son(at)raider(dot)co(dot)nz |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: how to detect the backup database every day |
| Date: | 2007-08-07 12:28:07 |
| Message-ID: | 46B86557.50901@archonet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
son(at)raider(dot)co(dot)nz wrote:
> Hello all
>
> I use a crontab job to backup and restore my database every midnight every
> day (using pg_dump and restore...)
>
> My cron job run well for a while. However, today I discovered that my
> database was not restored for one month.
>
> I also fix the problem as there is corruption in the script.
>
> My question is how I can detect whether the backup or restore processes is
> corrupted. I donot want that my backup database is one month old -:(
Well, if the script failed with an error, cron should have sent you an
email (or the user the script runs as, anyway).
If you didn't have an error, you could run a separate cron that checks
whether there are recent backup files and emails you if not (find ...
-mtime -1).
Or, if you want to make sure the restore has worked check the database
for a row with a recent timestamp.
--
Richard Huxton
Archonet Ltd
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rajaram J | 2007-08-07 13:20:14 | Having trouble building 64-bit pgsql 7.4.17 on HPUX ia64 |
| Previous Message | Geoffrey | 2007-08-07 11:46:45 | Re: backend process terminates |