Re: [DOCS] somewhat wrong archive_command example

2012-08-30 Thread Bruce Momjian
On Thu, Aug 30, 2012 at 09:11:01AM -0400, Bruce Momjian wrote: > On Thu, Aug 30, 2012 at 11:15:30AM +0200, Magnus Hagander wrote: > > On Thu, Aug 30, 2012 at 3:57 AM, Peter Eisentraut wrote: > > > On Mon, 2012-08-27 at 09:46 -0400, Bruce Momjian wrote: > > >> I thought the idea was just to show wh

Re: [DOCS] somewhat wrong archive_command example

2012-08-30 Thread Bruce Momjian
On Thu, Aug 30, 2012 at 11:15:30AM +0200, Magnus Hagander wrote: > On Thu, Aug 30, 2012 at 3:57 AM, Peter Eisentraut wrote: > > On Mon, 2012-08-27 at 09:46 -0400, Bruce Momjian wrote: > >> I thought the idea was just to show what a shell script might look like > >> --- we could say it does the sam

Re: [DOCS] somewhat wrong archive_command example

2012-08-30 Thread Magnus Hagander
On Thu, Aug 30, 2012 at 3:57 AM, Peter Eisentraut wrote: > On Mon, 2012-08-27 at 09:46 -0400, Bruce Momjian wrote: >> I thought the idea was just to show what a shell script might look like >> --- we could say it does the same as a single-line copy, but then people >> could improve it, or we could

Re: [DOCS] somewhat wrong archive_command example

2012-08-29 Thread Peter Eisentraut
On Mon, 2012-08-27 at 09:46 -0400, Bruce Momjian wrote: > I thought the idea was just to show what a shell script might look like > --- we could say it does the same as a single-line copy, but then people > could improve it, or we could add a comment to show how people could > improve it. Why can'

Re: [DOCS] somewhat wrong archive_command example

2012-08-27 Thread Bruce Momjian
On Sun, Aug 26, 2012 at 11:43:45PM -0400, Peter Eisentraut wrote: > I'm a little bit worried about this whole discussion. We have half a > dozen supposed experts working on a 10-line shell script to do WAL > archiving, and there is still > > - disagreement > - uncertainty > - bugs > > How is a n

Re: [DOCS] somewhat wrong archive_command example

2012-08-26 Thread Peter Eisentraut
I'm a little bit worried about this whole discussion. We have half a dozen supposed experts working on a 10-line shell script to do WAL archiving, and there is still - disagreement - uncertainty - bugs How is a normal user supposed to do this? That aside, I disagree with the premise for this sc

Re: [DOCS] somewhat wrong archive_command example

2012-08-25 Thread Bruce Momjian
On Sat, Aug 25, 2012 at 07:07:55PM -0400, Bruce Momjian wrote: > > >I have made all the suggestions posted and would like to add the > > >attached script to our documentation as a simple example. > > > > Btw., is anyone else concerned about using plain cp for this? If > > the cp fails half-way, i

Re: [DOCS] somewhat wrong archive_command example

2012-08-25 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 03:51:44PM -0400, Peter Eisentraut wrote: > On 8/15/12 9:13 PM, Bruce Momjian wrote: > >>Few more suggestions/nitpicks: > >> 1.) IMO it's more logical to put the test for whether the $ARCHIVE > >>directory exists before the test whether ${ARCHIVE}/${FILE} exists. > >> 2.)

Re: [DOCS] somewhat wrong archive_command example

2012-08-17 Thread Euler Taveira
On 17-08-2012 16:51, Peter Eisentraut wrote: > Btw., is anyone else concerned about using plain cp for this? If the cp fails > half-way, it leaves a partial file around, but subsequent file existence > checks will find the file OK and skip it. > I've already faced this problem (with cp and scp).

Re: [DOCS] somewhat wrong archive_command example

2012-08-17 Thread Peter Eisentraut
On 8/15/12 9:13 PM, Bruce Momjian wrote: Few more suggestions/nitpicks: 1.) IMO it's more logical to put the test for whether the $ARCHIVE directory exists before the test whether ${ARCHIVE}/${FILE} exists. 2.) I think the error code reporting here is not sound: cp ${FULLPATH} ${ARCHIVE}/${F

Re: [DOCS] somewhat wrong archive_command example

2012-08-15 Thread Bruce Momjian
On Thu, Sep 22, 2011 at 02:15:30PM -0400, Josh Kupershmidt wrote: > On Wed, Sep 21, 2011 at 8:59 PM, Euler Taveira de Oliveira > wrote: > > On 21-09-2011 20:02, Greg Smith wrote: > >> > >> Attached version fixes the late night brain fade errors. I think the right > >> thing to do next is to packag

Re: [DOCS] somewhat wrong archive_command example

2011-09-22 Thread Euler Taveira de Oliveira
On 22-09-2011 16:29, Josh Kupershmidt wrote: On Thu, Sep 22, 2011 at 2:41 PM, Euler Taveira de Oliveira wrote: On 22-09-2011 15:15, Josh Kupershmidt wrote: 1.) IMO it's more logical to put the test for whether the $ARCHIVE directory exists before the test whether ${ARCHIVE}/${FILE} exists.

Re: [DOCS] somewhat wrong archive_command example

2011-09-22 Thread Josh Kupershmidt
On Thu, Sep 22, 2011 at 2:41 PM, Euler Taveira de Oliveira wrote: > On 22-09-2011 15:15, Josh Kupershmidt wrote: >>  1.) IMO it's more logical to put the test for whether the $ARCHIVE >> directory exists before the test whether ${ARCHIVE}/${FILE} exists. > > No. If you do so, it will end up wastin

Re: [DOCS] somewhat wrong archive_command example

2011-09-22 Thread Euler Taveira de Oliveira
On 22-09-2011 15:15, Josh Kupershmidt wrote: Few more suggestions/nitpicks: 1.) IMO it's more logical to put the test for whether the $ARCHIVE directory exists before the test whether ${ARCHIVE}/${FILE} exists. No. If you do so, it will end up wasting a lot of cpu cycles testing something that

Re: [DOCS] somewhat wrong archive_command example

2011-09-22 Thread Josh Kupershmidt
On Wed, Sep 21, 2011 at 8:59 PM, Euler Taveira de Oliveira wrote: > On 21-09-2011 20:02, Greg Smith wrote: >> >> Attached version fixes the late night brain fade errors. I think the right >> thing to do next is to package this up into a doc update that corrects the >> errors in that section too; j

Re: [DOCS] somewhat wrong archive_command example

2011-09-21 Thread Euler Taveira de Oliveira
On 21-09-2011 20:02, Greg Smith wrote: Attached version fixes the late night brain fade errors. I think the right thing to do next is to package this up into a doc update that corrects the errors in that section too; just clean the whole thing up while I'm poking at it. I'll submit that over to t

Re: [DOCS] somewhat wrong archive_command example

2011-09-21 Thread Greg Smith
On 09/21/2011 09:58 AM, Peter Eisentraut wrote: I can see a few problems with your script, as far as making it into a generally reusable example: - Uses bash. Portable scripts shouldn't do this. - Overwrites PATH variable for unrelated purpose. - Path ($PATH) should be quoted everywhere. (By

Re: [DOCS] somewhat wrong archive_command example

2011-09-21 Thread Peter Eisentraut
On tis, 2011-09-20 at 22:45 -0400, Greg Smith wrote: > Attached is a working local_backup_script.sh that does the same basic > thing as the "Standalone Hot Backups" example. It includes lots of > error checking, useful messages when it doesn't work like this: > > Archive directory does not exis

Re: [DOCS] somewhat wrong archive_command example

2011-09-20 Thread Fujii Masao
On Wed, Sep 21, 2011 at 2:02 PM, Magnus Hagander wrote: > On Wed, Sep 21, 2011 at 03:58, Fujii Masao wrote: >> On Tue, Sep 20, 2011 at 10:34 PM, Magnus Hagander >> wrote: >>> On Tue, Sep 20, 2011 at 15:17, Peter Eisentraut wrote: At http://www.postgresql.org/docs/current/static/conti

Re: [DOCS] somewhat wrong archive_command example

2011-09-20 Thread Magnus Hagander
On Wed, Sep 21, 2011 at 03:58, Fujii Masao wrote: > On Tue, Sep 20, 2011 at 10:34 PM, Magnus Hagander wrote: >> On Tue, Sep 20, 2011 at 15:17, Peter Eisentraut wrote: >>> At >>> http://www.postgresql.org/docs/current/static/continuous-archiving.html >>> we say >>> >>> """ >>> Many people choose

Re: [DOCS] somewhat wrong archive_command example

2011-09-20 Thread Greg Smith
On 09/20/2011 09:17 AM, Peter Eisentraut wrote: At http://www.postgresql.org/docs/current/static/continuous-archiving.html we say """ Many people choose to use scripts to define their archive_command, so that their postgresql.conf entry looks very simple: archive_command = 'local_backup_script.

Re: [DOCS] somewhat wrong archive_command example

2011-09-20 Thread Fujii Masao
On Tue, Sep 20, 2011 at 10:34 PM, Magnus Hagander wrote: > On Tue, Sep 20, 2011 at 15:17, Peter Eisentraut wrote: >> At >> http://www.postgresql.org/docs/current/static/continuous-archiving.html >> we say >> >> """ >> Many people choose to use scripts to define their archive_command, so >> that t

Re: [DOCS] somewhat wrong archive_command example

2011-09-20 Thread Magnus Hagander
On Tue, Sep 20, 2011 at 15:17, Peter Eisentraut wrote: > At > http://www.postgresql.org/docs/current/static/continuous-archiving.html > we say > > """ > Many people choose to use scripts to define their archive_command, so > that their postgresql.conf entry looks very simple: > > archive_command =

[DOCS] somewhat wrong archive_command example

2011-09-20 Thread Peter Eisentraut
At http://www.postgresql.org/docs/current/static/continuous-archiving.html we say """ Many people choose to use scripts to define their archive_command, so that their postgresql.conf entry looks very simple: archive_command = 'local_backup_script.sh' """ It seems to me, however, that even a simp