目标: 将当前已使用的Centos的svn(subversion)版本库 备份到 Windows Server 环境Visual SVN中
源(Centos)服务器地址:svn://192.168.1.1/svn/srcA
备份(Windows Server)服务器地址:svn://192.168.1.2/svn/destA
-
windows环境建立镜像版本库
1 2 3 4 5 6 7 |
启动版本库 |
-
初始化镜像库(在源服务器上)
1 | #svnsync init 目的可访问地址 源版本库服务器地址
|
-
同步
1 2 |
|
-
解锁
1 2 |
|
- 1、在要备份的机器上建立版本库:
- 2、进入hooks目录:cd A/hooks/
- 3、创建pre-revprop-change文件:cp pre-revprop-change.tmpl pre-revprop-change
- 4、修改pre-revprop-change权限:chomd +x pre-revprop-change
5、修改文件:vi pre-revprop-change
为 echo “Changing revision properties other than svn:log is prohibited” >&2
exit 0(1修改为0) - 6、同步初步(在):
svnsync init svn://192.168.1.2/svn/destA svn://192.168.1.1/svn/srcA
svnsync: Destination repository is already synchronizing from ’svn://10.10.10.1′ - 7、实现同步:
svnsync sync file:///home/test/svn/test –username username –password password1
在源库的hooks下面,添加post-commit 脚本
可拷贝post-commit.tmpl即 :cp post-commit.tmpl post-commit
然后把 post-commit 中,最后两行替换为
svnsync sync --non-interactive svn://192.168.1.205/mu --sync-username user --sync-password user
即提交更新后,即执行同步命令,不进行交互
把post-commit 设为755权限。