Re: suggestion: atomic scp transactions

Bram Moolenaar <[email protected]> Fri, 23 Jan 2004 14:45:41 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Scott Henry Harrison wrote:

> Just a suggestion.  Is there a way
> to make the default scp transfer behavior
> be more atomic (i.e. "instantaneous")? 
> 
> For example, when transferring a big cgi
> file or collection of dependent modules,
> the web server experiences a period of
> down-time. 
> 
> Would it be possible to separate the network
> transfer lag from the critical filesystem changes? 

I can't think of a simple solution for this.  The best would probably be
to upload to a shadow copy of the website and then use a remote shell to
rename the tree (or move the individual files).

Note that it's never going to be perfect: People could have opened a
page and read it slowly (or go out to lunch), you change your website,
and when they later click on a link or submit the form they run into the
changes.

> I know this can be implemented with 3 lines
> of code (transfer to temporary directory and
> then recursively copy into desired location),
> but I would much rather type in a flag. 
> 
> Or, alternatively, maybe some sort of "tar"
> transfer mode like 
> 
> aap install PREFIX=scp_tarmode://somewhere// 
> 
> Or, maybe setting $SCP to be something like
> "tar cf - . | ssh somewhere 'cd destination; tar xf -'" 
> 
> If such a variation would work, maybe it
> could at least be added to the documentation?

This would require some thinking to make sure it works reliably.  It
probably only works with ssh and with a Unix webserver anyway.

> (I would like to somehow volunteer in this way
> or another way, or we can just make Bram do it <=== joke :=) ). 

You can hire me!

-- 
ARTHUR:  No, hang on!  Just answer the five questions ...
GALAHAD: Three questions ...
ARTHUR:  Three questions ...  And we shall watch ... and pray.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn