Re: how to detect the backup database every day

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: how to detect the backup database every day
Дата
Msg-id 46B86557.50901@archonet.com
обсуждение исходный текст
Ответ на how to detect the backup database every day  (son@raider.co.nz)
Ответы Re: how to detect the backup database every day
Список pgsql-general
son@raider.co.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Geoffrey
Дата:
Сообщение: Re: backend process terminates
Следующее
От: "Rajaram J"
Дата:
Сообщение: Having trouble building 64-bit pgsql 7.4.17 on HPUX ia64