使用svnsync备份很简单,步骤如下:
一、在备份机上创建一个空库:svnadmin create SMP
二、更改该库的钩子脚本pre-revprop-change(因为svnsync要改这个库的属性,也就是要将源库的属性备份到这个库,所以要启用这个脚本):
cd SMP/hooks;
cp pre-revprop-change.tmpl pre-revprop-change;
chmod 755 pre-revprop-change;
vi pre-revprop-change;
将该脚本后面的三句注释掉,或者干脆将它弄成一个空文件。
三、初始化,此时还没有备份任何数据:
svnsync init file:///home/backup/svn/svnsync/SMP/ http://svntest.subversion.com/repos/SMP
语法是:svnsync init {你刚创建的库url} {源库url}
注意本地url是三个斜杠的:///
四、开始备份:
svnsync sync file:///home/backup/svn/svnsync/SMP
这是就一个个版本进行备份了。
附录:
可能的报错一:
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
Failed to get lock on destination repos, currently held by 'bug1.corp.scmbbs.com:0c424c20-2e3b-0410-bd34-7fdd53c25d02'
svnsync: Couldn't get lock on destination repos after 10 attempts
这个时候可能属性被锁了,删掉属性:
svn propdel svn:sync-lock --revprop -r0 file:///home/backup/svn/svnsync/SMP
删除成功后,再试一遍基本就可以了。
如果反复操作都是同样错误的话,有可能是你的svn安装的有问题,重新安装一遍就好了,俺就是这样。
可能报错二、
svnsync: REPORT request failed on 'http://svn1.subversion.com/repos/Relevance'
svnsync: The requested report is unknown.
这是因为你源库的版本太低了,svnsync所需要的函数Report是svn1.4后加入的。没办法,对你的库进行升级后才能备份。
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。