Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ?

Поиск
Список
Период
Сортировка
Искать
От
vinny
Тема
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ?
Дата
Msg-id
10da6c146fc36f8124f5863bb824c615@xs4all.nl
Ответ на
Список
Дерево обсуждения
[PERFORM] How Can I check PostgreSQL backup is successfully or not ? Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Rick Otten <rottenwindfish@gmail.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? John Gorman <jgorman@eldocomp.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? vinny <vinny@xs4all.nl>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Rick Otten <rottenwindfish@gmail.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? "ldh@laurent-hasson.com" <ldh@laurent-hasson.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Gustavo Vargas <gustavo.nv@gmail.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Re: [PERFORM] How Can I check PostgreSQL backup is successfully ornot ? Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
On 2017-02-27 14:29, John Gorman wrote:
> Even though it's not listed in any of the documentation or “pg_dump
> --help” you can check the return code of the process. A return code
> greater than 0 (zero) usually indicates a failure
> 
> ./bin >pg_dump -U dummy_user  dummy_database; echo $?
> 
> 1
> 
> FROM: pgsql-performance-owner@postgresql.org
> [mailto:pgsql-performance-owner@postgresql.org] ON BEHALF OF Rick
> Otten
> SENT: Monday, February 27, 2017 3:36 AM
> TO: Dinesh Chandra 12108
> CC: pgsql-performance@postgresql.org
> SUBJECT: Re: [PERFORM] How Can I check PostgreSQL backup is
> successfully or not ?
> 
> Although it doesn't really tell if the pg_dump was successful (you'll
> need to do a full restore to be sure), I generate an archive list.  If
> that fails, the backup clearly wasn't successful, and if it succeeds,
> odds are pretty good that it worked:
> 
> On Mon, Feb 27, 2017 at 4:35 AM, Dinesh Chandra 12108
>  wrote:
> 
> Hi,
> 
> We are taking daily full backup of PostgreSQL database using PG_DUMP
> which is automatic scheduled through Cronjobs.
> 
> How can I check my yesterday backup is successfully or not?
> 
> Is there any query or view by which I can check it?
> 
> REGARDS,
> 
> DINESH CHANDRA
> 
> |DATABASE ADMINISTRATOR (ORACLE/POSTGRESQL)| CYIENT LTD. NOIDA.


It's important to note the distinction between

"the backup process did not fail"

and

"we now have a trustworthy backup"

And you can go full-paranoia and say that you can successfully create a 
perfectly working backup of the wrong database.

So what is it that you want to make sure of:
1. Did the process give an error?
2. Did the process create a usable backup?

What are the chances of #1 reporting success but still producing a bad 
backup?
And can #2 fail on a good database, and if so, can you detect that?



В списке pgsql-performance по дате отправления
От: John Gorman
Дата:
От: Dinesh Chandra 12108
Дата:
FAQ