Re: restore_command ignored in recovery.conf on standby

From: Rene Romero Benavides <rene(dot)romero(dot)b(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: restore_command ignored in recovery.conf on standby
Date: 2014-04-14 02:52:10
Message-ID: CANaGW0_PZcV+OZZPsN_Xx5V4PfX=uShmhsg0JvMtGyDbY8q0TQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yep, I checked:

[postgres(at)uxmal standby_node]$ /bin/tar -xzf
/db/wal_archives/00000001000001ED000000FB.tar.gz -C
/db/standby_node/pg_xlog/
[postgres(at)uxmal standby_node]$ echo $?
0
[postgres(at)uxmal standby_node]$ ls /db/standby_node/pg_xlog/ | grep
00000001000001ED000000FB
00000001000001ED000000FB

I read somewhere that in order for the extracted file to be placed at a
custom location you had to use that option -C

I'll try rewriting the command and debug it. Thanks for your comment.

2014-04-13 21:39 GMT-05:00 Stephen Frost <sfrost(at)snowman(dot)net>:

> Rene,
>
> * Rene Romero Benavides (rene(dot)romero(dot)b(at)gmail(dot)com) wrote:
> > restore_command='/bin/tar -xzf /db/wal_archives/%f.tar.gz -C %p'
> [...]
> > I tested the restore_command replacing variables and it works. Any ideas
> on
> > why it isn't being executed?
>
> Are you sure that it isn't being executed and just immediately returning
> '1' (meaning 'false'- aka, done with recovery)?
>
> The -C option to tar is supposed to be "change directory" according to
> the tar that I've got, and %p is the complete file name that PG wants
> the WAL file to be copied to- it's not a directory (it's something like
> pg_xlog/RECOVERY_WAL).
>
> Thanks,
>
> Stephen
>

--
El genio es 1% inspiración y 99% transpiración.
Thomas Alva Edison
http://pglearn.blogspot.mx/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2014-04-14 02:58:55 Re: restore_command ignored in recovery.conf on standby
Previous Message Stephen Frost 2014-04-14 02:39:56 Re: restore_command ignored in recovery.conf on standby