[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn update or rsync - which is best to update live files

From: Ryan Schmidt <subversion-2011a_at_ryandesign.com>
Date: Sat, 26 Feb 2011 16:47:23 -0600

On Feb 25, 2011, at 13:53, Blair Zajac wrote:

> On 2/25/11 11:39 AM, Christopher D Haakinson wrote:
>>
>
>> Now I've come to the point in my development where I need to figure out what's
>> the best method for transferring my svn files to my live site.
>>
>> I've read that I should use a post-commit hook, which is fine I'm using a
>> pre-commit hook already so I'm aware of how they work.
>>
>> My main question is: Which method is best for updating my live files? Should I
>> use rsync in my post hook or should I use svn update?
>>
>> http://subversion.apache.org/faq.html#website-auto-update this page recommends
>> using svn update, but I wanted to get some input from the community too.
>>
>> Thanks in advance!
>
> First, both svn and rsync do atomic replaces of the file, so you don't have to worry about the live files being observed in some odd state.

Of course you do. The individual files may be atomically replaced, but the entire set of files won't be. If, like most web sites, your site is made with a scripting language, and file A includes file B, and both files have been changed, there will probably be a time during the update when A has been updated and B has not, or vice versa.

Here is a previous discussion with recommendations. See especially the paragraph that starts "For finally deploying a site to the production server" and the example that follows:

http://svn.haxx.se/users/archive-2009-04/0083.shtml

We manually ran a script on the production server when we wanted to deploy a tag there. If you want to do automatic deploys in the post-commit hook of the repository server, for example in response to creating a tag with a particular naming format, then the SVN::Notify::Mirror perl module will help you do that. Its author has explained its use on this mailing list many times, for example here:

http://svn.haxx.se/users/archive-2006-02/1148.shtml
Received on 2011-02-26 23:48:01 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.