svnsync to mirror a subversion repository

I learned today that http access to my svn server was restricted to the campus. I want to share to the world, as described

https://pj.freefaculty.org/cgi-bin/mw/index.php?title=Cluster:Main#A_Collection_of_Simple_Working_Examples_Using_Qsub_and_Multi-core.2Fthreading.

svnsync is supposed to make this possible. I've not done it before, seems more complicated than it is because of arcane terminology.

Good guides help:

About Dreamhost in particular
http://wiki.dreamhost.com/Subversion#Quick_Start

http://blog.codefront.net/2007/03/31/setting-up-svnsync-ed-mirrored-svn-repositories-on-ubuntu-part-2-of-2/

http://journal.paul.querna.org/articles/2006/09/14/using-svnsync/

In the destination repo, I had to insert the hook file. From within the svn repo directory

$ cat hooks/pre-revprop-change
#!/bin/sh

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$USER" = "pauljohn32" ]; then exit 0; fi

echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1
Because my source repo is behind the firewall and the outside system can't get to it, it is necessary to customize a bit.

On hpc.quant.ku.edu:
$ FROMREPO=svn+ssh://pauljohn@hpc.quant.ku.edu/projects/svn/repos/hpcexample
$ export TOREPO=svn+ssh://pauljohn32@freefaculty.org/home/pauljohn32/svn/209657
$ svnsync init ${TOREPO} ${FROMREPO}
pauljohn32@freefaculty.org's password:
Copied properties for revision 0.

$ svnsync --non-interactive sync ${TOREPO}
pauljohn32@freefaculty.org's password:
Transmitting file data ..............
Committed revision 1.
Copied properties for revision 1.
Transmitting file data .....
Committed revision 2.
Copied properties for revision 2.
Transmitting file data ......................
Committed revision 3.
Copied properties for revision 3.
Transmitting file data ......
Committed revision 4.
Copied properties for revision 4.
Transmitting file data ....
Committed revision 5.
Copied properties for revision 5.
Transmitting file data .
Committed revision 6.
Copied properties for revision 6.
Transmitting file data ...............
Committed revision 7.
Copied properties for revision 7.

That copied the files into the svn folder in my account.

Dreamhost "goodies" (super easy) configurator has this set so I can check out copies through the http protocol. Mostly I intend that interface to be used for checkouts by read-only users, not developers.

http://svn.freefaculty.org/hpcexample

For example, this allows a check out without the user giving any credentials.

$ svn co http://svn.freefaculty.org/hpcexample

The only part of this I have not figured out yet is how to easily/automatically get updates from hpc.quant.ku.edu to svn.freefaculty.org. I'm not too worried, though, because I didn't think I'd get this far, and i did.

About pauljohn

Paul E. Johnson is a Professor of Political Science at the University of Kansas. He is an avid Linux User, an adequate system administrator and C programmer, and humility is one of his greatest strengths.
This entry was posted in Linux and tagged , , , , , , . Bookmark the permalink.