archive_command

Started by Jun Wangalmost 16 years ago6 messagesgeneral
Jump to latest
#1Jun Wang
junw2000@gmail.com

Where can I find an example shell script and windows batch file for
archive_command for backup?

Thanks.

Jack

#2Bruce Momjian
bruce@momjian.us
In reply to: Jun Wang (#1)
Re: archive_command

Jun Wang wrote:

Where can I find an example shell script and windows batch file for
archive_command for backup?

There are no examples. I can be any command you want, like 'COPY'.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ None of us is going to be here forever. +

#3Kenichiro Tanaka
ketanaka@ashisuto.co.jp
In reply to: Jun Wang (#1)
Re: archive_command

Hello

In my environment,archive_command works fine with this command.

archive_command = 'COPY %p C:\\Program
Files\\PostgreSQL\\8.4\\data\\archive\\%f'

(Is this what you want to know?)

Show quoted text

Where can I find an example shell script and windows batch file for
archive_command for backup?

Thanks.

Jack

#4Jun Wang
junw2000@gmail.com
In reply to: Kenichiro Tanaka (#3)
Re: archive_command

The document recommends a command as below:

archive_command = 'test ! -f /var/lib/pgsql/backup_in_progress || cp
-i %p /var/lib/pgsql/archive/%f < /dev/null'

How can this be done using windows batch? I tried the following
command, but it did not work:

archive_command = 'if not exist C:\\pgsql\\backup_in_progress || copy
%p C:\\pgsqlarchive\\%f'

The error is:

|| was unexpected at this time.

Thanks.

Jack

On Mon, May 31, 2010 at 5:40 PM, Kenichiro Tanaka
<ketanaka@ashisuto.co.jp> wrote:

Show quoted text

Hello

In my environment,archive_command works fine with this command.

archive_command = 'COPY %p C:\\Program
Files\\PostgreSQL\\8.4\\data\\archive\\%f'

(Is this what you want to know?)

Where can I find an example shell script and windows batch file for
archive_command for backup?

Thanks.

Jack

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Serge Fonville
serge.fonville@gmail.com
In reply to: Jun Wang (#4)
Re: archive_command

Hi,

On Tue, Jun 1, 2010 at 8:47 PM, Jun Wang <junw2000@gmail.com> wrote:

The document recommends a command as below:

archive_command = 'test ! -f /var/lib/pgsql/backup_in_progress || cp
-i %p /var/lib/pgsql/archive/%f < /dev/null'

How can this be done using windows batch? I tried the following
command, but it did not work:

archive_command = 'if not exist C:\\pgsql\\backup_in_progress || copy
%p C:\\pgsqlarchive\\%f'

The error is:

|| was unexpected at this time.

windows does not support OR in batch files.
if you remove || it should work....

HTH

Regards,

Serge Fonville

--
http://www.sergefonville.nl

Convince Google!!
They need to support Adsense over SSL
https://www.google.com/adsense/support/bin/answer.py?hl=en&amp;answer=10528
http://www.google.com/support/forum/p/AdSense/thread?tid=1884bc9310d9f923&amp;hl=en

#6Fujii Masao
masao.fujii@gmail.com
In reply to: Jun Wang (#4)
Re: archive_command

On Wed, Jun 2, 2010 at 3:47 AM, Jun Wang <junw2000@gmail.com> wrote:

The document recommends a command as below:

archive_command = 'test ! -f /var/lib/pgsql/backup_in_progress || cp
-i %p /var/lib/pgsql/archive/%f < /dev/null'

How can this be done using windows batch? I tried the following
command, but it did not work:

archive_command = 'if not exist C:\\pgsql\\backup_in_progress || copy
%p C:\\pgsqlarchive\\%f'

You want to take "standalone hot backup" instead of normal one? If not,
you don't need to check the file "backup_in_progress".

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center