Обсуждение: archive_command
Where can I find an example shell script and windows batch file for archive_command for backup? Thanks. Jack
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. +
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 >
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: > 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 >
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&answer=10528 http://www.google.com/support/forum/p/AdSense/thread?tid=1884bc9310d9f923&hl=en
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