Search Postgresql Archives

Re: how to detect the backup database every day

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



son@xxxxxxxxxxxx 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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux