subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Schmidt <subversion-20...@ryandesign.com>
Subject Re: svn update or rsync - which is best to update live files
Date Sat, 26 Feb 2011 22:47:23 GMT
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





Mime
View raw message