pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pallav Kalva <pkalva@livedatagroup.com>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Steve Crawford <scrawford@pinpointresearch.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Archive Command Configuration
Date: Fri, 24 Mar 2006 12:12:54 -0500
Message-ID: <44242896.1020701@livedatagroup.com> (raw)
In-Reply-To: <20060324164530.GT90527@pervasive.com>
References: <4422FD80.5080009@livedatagroup.com>
	<442304F9.4090708@pinpointresearch.com>
	<20060324114222.GV90527@pervasive.com>
	<442412BD.6090706@livedatagroup.com>
	<20060324164530.GT90527@pervasive.com>

Jim C. Nasby wrote:
>On Fri, Mar 24, 2006 at 10:39:41AM -0500, Pallav Kalva wrote:
>  
>>  What do you think about this option ? If I just do scp from the 
>>/archives folder, I will be ok and wont copy any partial files at any 
>>time right ?
>>archive_command = 'cp %p /archives-temp/%f && mv /archives-temp/%f 
>>/archives/%f' 
>>    
>
>A simple scp leaves you vulnerable to a WAL file only being partially
>copied if a backhoe hits at just the right moment. I believe that
>wouldn't be an issue with rsync, since it won't put a file in place
>until it's completely transfered. So if you want to use scp, I think
>you'd need to scp to a temporary directory, and then do a final move.
>  

Are you talking about scp to a temporary directory and move on a remote 
machine ?

The idea with this archive command is to make postgres copy first to 
"archive-temp" directory  and once the copy of the file is done 
completely then move it to "archives" directory on the source machine.
My cronjob then does scp from the archives folder on source machine 
regularly to a remote location, this way it never does a scp on a 
partial file since files are movied  only when it is completely copied.

This way I will never scp a partial file and be sure that copy on the 
remote machine is a complete clean copy.

(archive_command = 'cp %p /archives-temp/%f && mv /archives-temp/%f  
/archives/%f')



view thread (9+ messages)  latest in thread

Message-ID: <44242896.1020701@livedatagroup.com>
Permalink:  ../44242896.1020701@livedatagroup.com/
Also on:    postgresql.org/message-id/44242896.1020701@livedatagroup.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: pkalva@livedatagroup.com, jnasby@pervasive.com, scrawford@pinpointresearch.com
  Subject: Re: Archive Command Configuration
  In-Reply-To: <44242896.1020701@livedatagroup.com>
  References: <4422FD80.5080009@livedatagroup.com> <442304F9.4090708@pinpointresearch.com> <20060324114222.GV90527@pervasive.com> <442412BD.6090706@livedatagroup.com> <20060324164530.GT90527@pervasive.com> <44242896.1020701@livedatagroup.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox