Re: Pg_stop_backup process does not run - Backup Intervals

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Rodrigo Cavalcante <rodrigo(dot)java(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pg_stop_backup process does not run - Backup Intervals
Date: 2016-05-03 15:19:52
Message-ID: CA+TgmoY3RsByiFLoCLa6wkBF3NFGrS9AFaLvfvPHKLupG0VBWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 2, 2016 at 3:03 PM, Rodrigo Cavalcante
<rodrigo(dot)java(at)gmail(dot)com> wrote:
> On alternate days my backup is failing, by the pg_stop_backup process ()
> does not perform or quit.
>
> Version PostgreSQL: 9.1.6
>
> The following backup script:
>
> PGDATA=/dados
> SAVE_BASE_DIR=/backup/diario
> backup="'bkpfull'"
> data=$(date +'%d%m%y')
>
> WAL_DIR=/backup/archive
>
> mv $WAL_DIR/* $WAL_DIR/wal_anterior
>
> psql -U postgres -h localhost -c 'select pg_start_backup('$backup',true);'
> template1 && \
>
> tar -czvf $SAVE_BASE_DIR/$data.tar.gz $PGDATA && psql -U postgres -h
> localhost -c 'select pg_stop_backup();' template1

I'm going to refer you to
https://wiki.postgresql.org/wiki/Guide_to_reporting_problems

You aren't being very clear about what actually happens here, and you
haven't mentioned what showed up in the logs, either. If I had to
guess, I'd guess that if you look at the output of this backup script
on alternate days, you'll find that some step in here is failing on
alternate days, with an error message to tell you which step is
failing and in what way. That might help you figure out the problem.

Also, consider using one of the various backup toolkits that already
exist instead of writing your own script. Also, consider using
pg_basebackup. These tend to be more reliably than home-grown
scripts.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-05-03 15:23:23 Re: pgindent fixups
Previous Message Stephen Frost 2016-05-03 15:08:53 Re: SET ROLE and reserved roles