Document why 'cp -i
authorBruce Momjian
Wed, 31 Mar 2010 23:35:19 +0000 (23:35 +0000)
committerBruce Momjian
Wed, 31 Mar 2010 23:35:19 +0000 (23:35 +0000)
doc/src/sgml/backup.sgml

index f98417d283f30906b156660ce8b23ff5dd5834ce..2707e184b2c81e04c46b135533b42bcb742e74f7 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  Backup and Restore
@@ -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, and that it returns
-    nonzero status in this case.  We have found that 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, cp
+    -i causes copy to prompt before overwriting a file, and
+    < /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:
 
 archive_command = 'test ! -f .../%f && cp %p .../%f'