diff options
author | Bruce Momjian <bruce@momjian.us> | 2010-03-31 23:35:19 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2010-03-31 23:35:19 +0000 |
commit | cba349859640b3c1f3f2e33f102b313b9efe2d92 (patch) | |
tree | 938050cb2e7ea4457c8ca6bbac9dd58d56cc9169 | |
parent | f185fc3c5e119f03e8057e8f741df4d4f6c50713 (diff) | |
download | postgresql-cba349859640b3c1f3f2e33f102b313b9efe2d92.tar.gz |
Document why 'cp -i </dev/null' is suggested for archive command.
-rw-r--r-- | doc/src/sgml/backup.sgml | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index f98417d283..2707e184b2 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.144 2010/02/22 17:15:10 momjian Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.145 2010/03/31 23:35:19 momjian Exp $ --> <chapter id="backup"> <title>Backup and Restore</title> @@ -604,11 +604,12 @@ cp -i pg_xlog/00000001000000A900000065 /mnt/server/archivedir/00000001000000A900 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: + 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> |