Rsync vs Subversion

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Rsync vs Subversion

Post by Ollie Saunders »

For the last 2 months on and off I've been configuring my own dedicated production server. I've done firewalls, kernels, SSH, apache, php, mysql, pear, pecl, mod this, mod that and written unit tests (in PHP) to prove that all of it, well most of it, works. The last thing on my "to do" is the subject of this post.

Basically I want to run web sites and web applications on this server. I use some PHP libraries and well as my own home-grown framework. I wish to use subversion version control for my framework and libraries at a minimum and have a mechanism for synchronizing development and production version of sites and applications. There is a fair bit of data that I do not want to synchronize: logs, data files, session files etc. I would also like to be able to develop from home or at work. Currently only I work on these files but in future there will probably be more than myself, so I guess version control becomes more important.

My current directory structure looks like this:

Code: Select all

/web/
   log/ # site inspecific logging
   sites/ # virtualhosts
      someSite/ # example site
          code/ # PHP sources including libraries
              libraryName/ # a library
              someSite/ # application sources
          debug/ # xdebug profiles
          foo.htvh # sym linked virtualhost configuration
          log/ # site specific logging
          session/ # session data, usually not used (memcache usually)
          upload/ # uploaded files tmp dir
          www/ # vh docroot
The way I see it I have 3 options. It would be nice if someone could explain how they manage this stuff and what the implications of these options are.
  1. Put everything under a single subversion repository. This means I've got to execute svn add, svn move etc. commands whenever I'm working with ALL files and be conscientious about keeping the files I do want to synchronize between servers out of version control. But it does mean I can sync everything in a single command and I can revert everything.
  2. Only Keep libraries in a repository and rsync everything else. I've really no idea how to use rsync or how it would work rsyncing subversion check-outs. I know rsync can be instructed not to sync certain things and it doesn't require me having to remember to use the svn command when I want to move, add or delete stuff not in version control.
  3. Rsync everything. No version control but possibly the simplest and fastest. This probably isn't acceptable unless someone comes up with a good reason why I should consider it.
Finally there must be security considerations regarding rsync and subversion anyone know any good articles?

EDIT | Actually I'm leaning quite strongly to subversion for everything now because it's better to only have one system and if I am prepared to enter those svn commands for code, which I edit more than anything else, then there shouldn't be a problem doing it for images and all that. Just as long as I can work out a way of keeping server specific stuff err.. server specific.
Post Reply