public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bruce Momjian <[email protected]>
To: Josh Kupershmidt <[email protected]>
Cc: [email protected]
Subject: Re: confusing archive_command example
Date: Wed, 31 Mar 2010 19:39:21 -0400 (EDT)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Josh Kupershmidt wrote:
> Hi,
> On the page:
> http://www.postgresql.org/docs/current/interactive/continuous-archiving.html#BACKUP-ARCHIVING-WAL
>
> an example archive_command of:
> archive_command = 'cp -i %p /mnt/server/archivedir/%f </dev/null'
>
> is given. Then, a few lines later, an example archive command of:
> archive_command = 'test ! -f .../%f && cp %p .../%f'
>
> is given. I think this second command would be more clear if it used
> "/mnt/server/archivedir/" instead of "...", to tie in with the
> previous archive_command. It took me a minute to figure out that the
> three dots were supposed to be an ellipsis instead of a typo for the
> parent directory "..".
I agree our use of cp -i </dev/null is a little too fancy not to be
explained in the docs, so I have done so with the attached, applied
patch.
As far as "...", those are used to show only the important changes in
the string, which I think is the right approach, but I did change the
line so the dots are not right up against slashes:
archive_command = 'test ! -f ... %f && cp %p ... %f'
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
Attachments:
[text/x-diff] /rtmp/diff (1.6K, 2-%2Frtmp%2Fdiff)
download | inline diff:
Index: doc/src/sgml/backup.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v
retrieving revision 2.144
diff -c -c -r2.144 backup.sgml
*** doc/src/sgml/backup.sgml 22 Feb 2010 17:15:10 -0000 2.144
--- doc/src/sgml/backup.sgml 31 Mar 2010 23:34:20 -0000
***************
*** 604,614 ****
directory).
It is advisable to test your proposed archive command to ensure that it
indeed does not overwrite an existing file, <emphasis>and that it returns
! nonzero status in this case</>. We have found that <literal>cp -i</> does
! this correctly on some platforms but not others. If the chosen command
! does not itself handle this case correctly, you should add a command
! to test for existence of the archive file. For example, something
! like:
<programlisting>
archive_command = 'test ! -f .../%f && cp %p .../%f'
</programlisting>
--- 604,615 ----
directory).
It is advisable to test your proposed archive command to ensure that it
indeed does not overwrite an existing file, <emphasis>and that it returns
! nonzero status in this case</>. On many Unix platforms, <command>cp
! -i</> causes copy to prompt before overwriting a file, and
! <literal>< /dev/null</> causes the prompt (and overwriting) to
! fail. If your platform does not support this behavior, you should
! add a command to test for the existence of the archive file. For
! example, something like:
<programlisting>
archive_command = 'test ! -f .../%f && cp %p .../%f'
</programlisting>
view thread (13+ 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], [email protected]
Subject: Re: confusing 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