Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcba3498

Browse files
committed
Document why 'cp -i </dev/null' is suggested for archive command.
1 parentf185fc3 commitcba3498

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎doc/src/sgml/backup.sgml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.144 2010/02/22 17:15:10 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.145 2010/03/31 23:35:19 momjian Exp $ -->
22

33
<chapter id="backup">
44
<title>Backup and Restore</title>
@@ -604,11 +604,12 @@ cp -i pg_xlog/00000001000000A900000065 /mnt/server/archivedir/00000001000000A900
604604
directory).
605605
It is advisable to test your proposed archive command to ensure that it
606606
indeed does not overwrite an existing file, <emphasis>and that it returns
607-
nonzero status in this case</>. We have found that <literal>cp -i</> does
608-
this correctly on some platforms but not others. If the chosen command
609-
does not itself handle this case correctly, you should add a command
610-
to test for existence of the archive file. For example, something
611-
like:
607+
nonzero status in this case</>. On many Unix platforms, <command>cp
608+
-i</> causes copy to prompt before overwriting a file, and
609+
<literal>&lt; /dev/null</> causes the prompt (and overwriting) to
610+
fail. If your platform does not support this behavior, you should
611+
add a command to test for the existence of the archive file. For
612+
example, something like:
612613
<programlisting>
613614
archive_command = 'test ! -f .../%f &amp;&amp; cp %p .../%f'
614615
</programlisting>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp