On Mon, May 2, 2016 at 3:03 PM, Rodrigo Cavalcante <rodrigo.j...@gmail.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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers