Re: archive_command fails but works outside of Postgres

From: twoflower <standa(dot)kurik(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: archive_command fails but works outside of Postgres
Date: 2017-08-18 20:41:49
Message-ID: 1503088909427-5979060.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera-9 wrote
> I saw one installation with "gsutil cp" in archive_command recently.
> Ithad the CLOUDSDK_PYTHON environment variable set in the
> archive_commanditself. Maybe that's a problem.

That's not the case here, I don't have this variable set anywhere where
gsutil works.
Alvaro Herrera-9 wrote
> Another possible problem might be the lack of %f (this command seems
> torely on the file being the same name at the other end, which
> isn'tnecessarily so) and the fact that %p is supposed to be the path of
> thefile, so you shouldn't qualify it with the full path.

%p is not the full path, it is relative to the cluster's data directory (as
described in the documentation
<https://www.postgresql.org/docs/9.6/static/continuous-archiving.html#BACKUP-ARCHIVING-WAL>
).Not using %f is not a problem - gsutil is invoked in the following way:
gsutil &lt;full_path&gt; &lt;storage_dir&gt;
Also, as I mentioned, the command works fine when copied verbatim from the
log error message and executed manually.

--
View this message in context: http://www.postgresql-archive.org/archive-command-fails-but-works-outside-of-Postgres-tp5979040p5979060.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message twoflower 2017-08-18 20:42:57 Re: archive_command fails but works outside of Postgres
Previous Message twoflower 2017-08-18 20:35:51 Re: archive_command fails but works outside of Postgres