From: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
To: vinny <vinny@xs4all.nl>
To: John Gorman <jgorman@eldocomp.com>
Cc: Rick Otten <rottenwindfish@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Cc: pgsql-performance-owner@postgresql.org <pgsql-performance-owner@postgresql.org>
Subject: Re: How Can I check PostgreSQL backup is successfully or not ?
Date: Mon, 27 Feb 2017 14:10:52 +0000
Message-ID: <c75a1941c39f4e5c8797cd2b445d374c@cyient.com> (raw)
In-Reply-To: <10da6c146fc36f8124f5863bb824c615@xs4all.nl>
References: <7080564fb84f4bd0b178d86062b4790f@cyient.com>
<CAMAYy4JZ_BE7iH2jui_p4FLuHDaj7oqr0O6180Z0EXzv_3obig@mail.gmail.com>
<0A1B0B276DEE6441A2E68EB66D4540DAD71D12C7@WINEX1.eldocomp.com>
<10da6c146fc36f8124f5863bb824c615@xs4all.nl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Hi,
I run the below command
[postgres@CPPMoma-DB05 bin]$ pg_dump -U postgres moma_ts_oce; echo $
Output was like this(Last few lines )
------------------------------
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
$
Regards,
Dinesh Chandra
|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.
------------------------------------------------------------------
Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com
Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
-----Original Message-----
From: vinny [mailto:vinny@xs4all.nl]
Sent: 27 February, 2017 7:31 PM
To: John Gorman <jgorman@eldocomp.com>
Cc: Rick Otten <rottenwindfish@gmail.com>; Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>; pgsql-performance@postgresql.org; pgsql-performance-owner@postgresql.org
Subject: Re: [PERFORM] How Can I check PostgreSQL backup is successfully or not ?
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
> <Dinesh.Chandra@cyient.com> 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?
________________________________
DISCLAIMER:
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Check all attachments for viruses before opening them. All views or opinions presented in this e-mail are those of the author and may not reflect the opinion of Cyient or those of our affiliates.
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: Dinesh.Chandra@cyient.com, vinny@xs4all.nl, jgorman@eldocomp.com, rottenwindfish@gmail.com, pgsql-performance-owner@postgresql.org
Subject: Re: How Can I check PostgreSQL backup is successfully or not ?
In-Reply-To: <c75a1941c39f4e5c8797cd2b445d374c@cyient.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox