[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Questions about mirror'ing a website



On Fri, Nov 22, 2002 at 11:13:30PM -0800, Michelle Storm wrote:
> I am just after suggestions on the best and/or most efficient means to
> mirror my website (exactly) from one location to another (currently on
> same computer, but eventually multiple computers).

Consider using version control (CVS or Subversion are the obvious
candidates). Your working and live directories can just be checkouts,
and it's easy to do 'cvs up' or 'svn up' from cron every day for the
live site. Plus you get history for free. All you have to do is
occasionally check in what you've done.

Subversion tracks renames, unlike CVS. I use it for my web site and much
of my home directory. However it's still considered alpha and in heavy
development, so it's perhaps not to everyone's taste just yet.

Neither of these handle permissions or symlinks yet. You can probably do
these using .htaccess files just as easily, or perhaps with a Makefile.

> A few things to keep in mind.
> 1) LIVE has a different "owner:group" than WORKING.

Trivial if they're both working copies of a repository; LIVE just does
the checkout as a different uid and gid.

> 2) If I move/rename files or diretories, I need this updated.

In CVS you'll have to 'cvs rm' the old file and 'cvs add' the new one
(well, there are other tricks if you need to preserve history more
elegantly than that). In Subversion you can 'svn mv'. Both will be
tracked in working copies when they're updated.

> 3) It only has to update once every 24 hours. <- Probably cron to do this.

Easy - see above.

(Incidentally, if you go for CVS, you'll be able to move the repository
into Subversion later when that becomes stable.)

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: