-
全量备份原始SVN库 - master
svnadmin hotcopy repos/ repos.bak -
将master上的备份库拷贝到slave - slave
scp -r root@IP://home/svn/pon/repos.bak repos -
创建slave机库 - slave
svnadmin create /home/svnbak/NEW_PON
cp /home/svnbak/NEW_PON/hooks/pre-revprop-change.tmpl /home/svnbak/NEW_PON/hooks/pre-revprop-change
vim /home/svnbak/NEW_PON/hooks/pre-revprop-change将最后一行的exit 1修改为exit 0
chmod 755 /home/svnbak/NEW_PON/hooks/pre-revprop-change
svnsync init file:///home/svnbak/NEW_PON svn://IP --username xxxx --password xxxxx -
备份slave机库并重命名从master机上拷贝的库
mv /home/svnbak/NEW_PON/ /home/svnbak/NEW_PON.bak
mv /home/svnbak/repos/ /home/svnbak/NEW_PON
注意将目录命名为slave机上创建库的名称 -
拷贝slave机原库的一些文件到新库
rm -f /home/svnbak/NEW_PON/hooks/pre-revprop-change
cp -f /home/svnbak/NEW_PON.bak/hooks/pre-revprop-change /home/svnbak/NEW_PON/hooks/pre-revprop-change
rm -f /home/svnbak/NEW_PON/db/uuid
cp -f /home/svnbak/NEW_PON.bak/db/uuid /home/svnbak/NEW_PON/db/uuid
rm -f /home/svnbak/NEW_PON/db/revprops/0/0
cp -f /home/svnbak/NEW_PON.bak/db/revprops/0/0 /home/svnbak/NEW_PON/db/revprops/0/0
-
查看slave新库所对应的最新版本号
cat /home/svnbak/NEW_PON/db/current获取master库热备份时的最新版本号
svn propset --revprop -r0 svn:sync-last-merged-rev 41675 file:///home/svnbak/NEW_PON -
执行同步
svnsync sync file:///home/svnbak/NEW_PON
cat /home/svnbak/NEW_PON/db/current获取当前slave机新库的最新版本号,看看是不是已经同步了 -
添加crondtab定时任务,ok
网友评论