public inbox for [email protected]
help / color / mirror / Atom feedFrom: Greg Smith <[email protected]>
Cc: [email protected]
Subject: Re: somewhat wrong archive_command example
Date: Wed, 21 Sep 2011 19:02:37 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
On 09/21/2011 09:58 AM, Peter Eisentraut wrote:
> I can see a few problems with your script, as far as making it into a
> generally reusable example:
>
> - Uses bash. Portable scripts shouldn't do this.
>
> - Overwrites PATH variable for unrelated purpose.
>
> - Path ($PATH) should be quoted everywhere. (By contrast, you don't
> need the quotes in PATH="$1". Just saying ...)
>
> - cp shouldn't be called with an absolute path.
>
Most of these problems stemmed from the unnoticed fact that I'd made
PATH the name of my variable. The absolute path for cp for example?
Added that because it couldn't seem to find cp in the PATH, which was
driving me crazy for a while there...sigh.
Attached version fixes the late night brain fade errors. I think the
right thing to do next is to package this up into a doc update that
corrects the errors in that section too; just clean the whole thing up
while I'm poking at it. I'll submit that over to the hackers list so
that everyone can take a shot at correcting my shell code.
--
Greg Smith 2ndQuadrant US [email protected] Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
Attachments:
[application/x-sh] local_backup_script.sh (672B, 2-local_backup_script.sh)
download
view thread (24+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: somewhat wrong archive_command example
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox