Re: confusing archive_command example

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: confusing archive_command example
Дата
Msg-id
201003312339.o2VNdLq23837@momjian.us
Ответ на
Список
Дерево обсуждения
confusing archive_command example Josh Kupershmidt <schmiddy@gmail.com>
Re: confusing archive_command example Bruce Momjian <bruce@momjian.us>
Re: confusing archive_command example "Greg Sabino Mullane" <greg@turnstep.com>
Re: confusing archive_command example Tom Lane <tgl@sss.pgh.pa.us>
Re: confusing archive_command example Bruce Momjian <bruce@momjian.us>
Re: confusing archive_command example Tom Lane <tgl@sss.pgh.pa.us>
Re: confusing archive_command example Bruce Momjian <bruce@momjian.us>
Re: confusing archive_command example Tom Lane <tgl@sss.pgh.pa.us>
Re: confusing archive_command example Bruce Momjian <bruce@momjian.us>
Re: confusing archive_command example Peter Eisentraut <peter_e@gmx.net>
Re: confusing archive_command example Bruce Momjian <bruce@momjian.us>
Re: confusing archive_command example Greg Smith <greg@2ndquadrant.com>
Re: confusing archive_command example Bruce Momjian <bruce@momjian.us>
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  
> 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         http://momjian.us
  EnterpriseDB                             http://enterprisedb.com
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, 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:
  
  archive_command = 'test ! -f .../%f && cp %p .../%f'
  
--- 604,615 ----
      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</>.  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'
  
В списке pgsql-docs по дате отправления
От: Heikki Linnakangas
Дата:
От: Tom Lane
Дата:
FAQ