Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciLsn-00074T-Nt for pgsql-performance@arkaria.postgresql.org; Mon, 27 Feb 2017 14:02:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciLsn-0001ap-1R for pgsql-performance@arkaria.postgresql.org; Mon, 27 Feb 2017 14:02:33 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciLqz-0005uT-Vb for pgsql-performance@postgresql.org; Mon, 27 Feb 2017 14:00:42 +0000 Received: from lb2-smtp-cloud2.xs4all.net ([194.109.24.25]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ciLqv-0003DB-Vg for pgsql-performance@postgresql.org; Mon, 27 Feb 2017 14:00:40 +0000 Received: from webmail.xs4all.nl ([194.109.20.195]) by smtp-cloud2.xs4all.net with ESMTP id pq0Y1u00T4CYHle01q0YGF; Mon, 27 Feb 2017 15:00:33 +0100 Received: from mail.genj.nl ([77.242.116.162]) by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Mon, 27 Feb 2017 15:00:32 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 27 Feb 2017 15:00:32 +0100 From: vinny To: John Gorman Cc: Rick Otten , Dinesh Chandra 12108 , pgsql-performance@postgresql.org, pgsql-performance-owner@postgresql.org Subject: Re: How Can I check PostgreSQL backup is successfully or not ? In-Reply-To: <0A1B0B276DEE6441A2E68EB66D4540DAD71D12C7@WINEX1.eldocomp.com> References: <7080564fb84f4bd0b178d86062b4790f@cyient.com> <0A1B0B276DEE6441A2E68EB66D4540DAD71D12C7@WINEX1.eldocomp.com> Message-ID: <10da6c146fc36f8124f5863bb824c615@xs4all.nl> X-Sender: vinny@xs4all.nl User-Agent: XS4ALL Webmail X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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? -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance