The absolutely minimal recovery.conf contains a single line with
restore_command. But even that can not be written in a universal way.
In the simplest case, writing the minimal recovery.conf would be something
like this (you can put this into your shell script):

    cat > recovery.conf << EOF
    restore_command = 'wal-e wal-fetch "%f" "%p"'
    EOF

But, for example, on my servers, I use gpg for encrypting every part of the
archive, which makes this line look a lot different. Here it is, using
PATH override for "gpg" substitution, as wal-e does not allow to change the
"gpg" binary path, and using "envdir" to load S3 credentials.

    cat > recovery.conf << EOF
    restore_command = 'PATH=/var/backups/postgres/env_path/:$PATH envdir
"$ENVDIR" wal-e wal-fetch "%f" "%p"'
    EOF

Considering all this, I suggest the only sane way to do something about it
for wal-e is to insert some useful help after doing "wal-e backup fetch".
Or just printing the URL to the wiki, which explains what to do next.

P.S. In case you want to take a look,
here's my whole restore script, which handles gpg-encrypted files.

https://gist.github.com/ikatson/e2e6250cd8942ade70f5


On Mon, Aug 4, 2014 at 10:09 AM, Daniel Farina <[email protected]> wrote:

> On Mon, Aug 4, 2014 at 8:59 AM, Josh Joy <[email protected]> wrote:
> >> What stops you from writing a simple shell script?
> >
> > 1) Previous work that has already been done
> > 2) Simple is relative. I would more than likely write python code so I
> can
> > integrate with the nice backup-list functionality that has a menu option.
>
> Write that shell script.  Or python integration.
>
> Although I haven't tried in a while, the problem I have been content
> to leave un-solved is that I haven't been able to meaningfully
> simplify the model of recovery.conf generation in a way that handles a
> lot of use cases.  Instead I impose a model almost as complex as
> recovery.conf itself but not-quite recovery.conf, which is already
> well-documented, familiar, and common to many postgres tools.
>
> So, in principle it'd be nice to simplify, but I haven't seen nor been
> seeking a drastic simplification as to warrant carrying a feature in
> WAL-E just yet.
>
> Proposals welcome.
>

-- 
You received this message because you are subscribed to the Google Groups 
"wal-e" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to