replicating a subversion repository with svnsync

svnsync can be used to synchronize a remote subversion repository into a local one, this can be useful as a backup mechanism or to allow a trac (http://trac.edgewall.org/) instance to access subversion when it is impractical to host both on the same computer.

Create the new subversion repository and initialize it
svnadmin create svn.example.com

Create the pre-revprop-change hook script required by svnsync

Initialize the repository 
svnsync init file://$PWD/svn.example.com https://svn.example.com/

Resynchronize the repository with the master
svnsync sync file://$PWD/svn.example.com

Setup crontab to perform this operation every 5 minutes
crontab -e
*/5 * * * * /usr/bin/svnsync sync --non-interactive file:///opt/svn.example.com

NOTE: svnsync creates a lock property and if it fails for some reason this lock will prevent any further synchronizations, to remove it use the following
svn proplist --revprop -r 0 file:///opt/svn.example.com/
svn propdel svn:sync-lock --revprop -r 0  file:///opt/svn.example.com/