mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Update archive_command example to use || test, rather than if [].
This commit is contained in:
parent
8e179aeb9e
commit
3791d26d4b
@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.111 2007/12/17 04:30:05 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.112 2007/12/17 09:03:52 momjian Exp $ -->
|
||||
|
||||
<chapter id="backup">
|
||||
<title>Backup and Restore</title>
|
||||
@ -1290,7 +1290,7 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows
|
||||
<literal>on</>, and set up an <varname>archive_command</> that performs
|
||||
archiving only when a <quote>switch file</> exists. For example:
|
||||
<programlisting>
|
||||
archive_command = 'if [ -f /var/lib/pgsql/backup_in_progress ]; then cp -i %p /var/lib/pgsql/archive/%f </dev/null ; fi'
|
||||
archive_command = 'test ! -f /var/lib/pgsql/backup_in_progress || cp -i %p /var/lib/pgsql/archive/%f < /dev/null'
|
||||
</programlisting>
|
||||
This command will perform archiving when
|
||||
<filename>/var/lib/pgsql/backup_in_progress</> exists, and otherwise
|
||||
|
Loading…
Reference in New Issue
Block a user