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

RE: best option for read-only copy of repository?

From: HAND,Nathan <Nathan.HAND_at_dewr.gov.au>
Date: 2004-12-14 00:57:44 CET

> -----Original Message-----
> From: Subversion Newbie [mailto:subversionnewbie@yahoo.com]
> Sent: Tuesday, December 14, 2004 10:44 AM
> To: users@subversion.tigris.org
> Subject: best option for read-only copy of repository?
>
>
> We plan to have a main read-write repository at one location,
> and another read-only copy at a remote location which will be
> updated over a T1 line. The "SVN::Mirror" perl module (and
> its command-line "svm-mirror") looks like a good way to go
> about doing this, but I'm wondering if anyone can suggest
> better alternatives. (I'm not complaining about svn-mirror,
> which looks great.) Thanks.

If the mirror is read-only then you can use a dump/restore hook script.

  #!/bin/sh
  #
  # this is /repos/hooks/post-commit
  #

  REPOS="$1"
  REV="$2"

  RREV=`/usr/local/bin/ssh -i /var/svn/conf/id_dsa.svnyoung
svn@remotehost`
  RREV=`echo $RREV 1 + p | dc`

  /usr/local/bin/svnadmin dump --incremental -r${RREV}:${REV} ${REPOS} |
\
        /usr/local/bin/ssh -i /var/svn/conf/id_dsa.svnmirror
svn@remotehost

The two DSA keys invoke commands on the remote server via the magic of
~/.ssh/authorized_keys.

  command="/usr/local/bin/svnlook youngest /var/svn" ssh-dss
DSA-KEY-HERE
  command="/usr/local/bin/svnadmin load /var/svn" ssh-dss DSA-KEY-HERE

Commits on the mirror can foul things up. You can prevent commits on the
mirror by adding a dummy hook script.

  #!/bin/sh
  #
  # this is /repos/hooks/start-commit
  #
  exit 1 # always fail

NB: If the DSA keys are too much then you can just put those two
commands
in the post-commit hook script instead.

Notice:
The information contained in this e-mail message and any attached files may
be confidential information, and may also be the subject of legal
professional privilege. If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete all copies of this transmission together with any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 14 01:01:51 2004

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.