svnsync:subversion a good tool for backing up the repository
From svn Knowledge BaseRevision as of 22:35 February 19, 2008; View Current revision
←older Revision | Newer Revision→jump to:navigation, search
Author: pcplayer
From: I use subversion-http://www.iusesvn.com
Date: 2008-1-2
This article describes the use of Svnsync to synchronize the repository, to achieve the purpose of backing up the repository
There are two commands to use.
1. Svnsync Init
Initialize, establish a synchronization relationship between the target library and the source library
Command format svnsync init target library URL Source Library URL
2. Svnsync Sync
True synchronization
Command format svnsync sync target library URL
Goal:
This implementation is the remote automatic backup of the repository, backup the repository to another machine
Suppose we want to synchronize the source repository for http://192.168.0.1/svn/proj1 located at machine A, the specific path we don't have to ignore because we use the HTTP protocol
Target library in Machine b,file:///svn/proj1, this for simplicity and security, we use file://protocol
Process:
1. On machine B, create the target library
Mkdir/svn
Svnadmin create/svn/proj1
2, modify the target library script Pre-revprop-change
Enter/svn/proj1/hooks/
cd/svn/proj1/hooks/
CP Pre-revprop-change.tmpl Pre-revprop-change
VI Pre-revprop-change
Repos= "$"
rev= "$"
User= "$"
Propname= "$4"
Action= "$"
If ["$ACTION" = "M"-a "$PROPNAME" = "Svn:log"]; Then exit 0; Fi
echo "Changing revision properties other than Svn:log is prohibited" >&2
Exit 1
The original script means that if you modify the Svn:log property, it will allow the modification to return 0; otherwise, it is not allowed to return 1
We want to change it to allow all properties to be modified, return 0 directly in the script, the new script is as follows:
Exit 0;
3. Initialization
Svnsync init file:///svn/proj1 http://192.168.0.1/svn/proj1 will prompt for a user name and password, the user name and password provided here are fully readable http://192.168.0.1/svn/ PROJ1 User name and password
4. Synchronization
Svnsync Sync file:///svn/proj1
You will still be prompted for your username and password, but you can add the username, password parameters after this command,
For example Svnsync Sync file:///svn/proj1--username username--password password