分类: 系统运维
2013-10-09 10:10:09
1、 yum -y install mod_dav_svn subversion
查看svn版本
svnserve --version svnserve, version 1.6.11 (r934486) compiled Sep 27 2011, 15:29:25 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see This product includes software developed by CollabNet (). The following repository back-end (FS) modules are available: * fs_base : Module for working with a Berkeley DB repository. * fs_fs : Module for working with a plain file (FSFS) repository. Cyrus SASL authentication is available.
2、初始化subversion的仓库
mkdir /data/svn/ cd /data/svn svnadmin create test cd test/ # ls conf db format hooks locks README.txt cd conf/ # ls authz passwd svnserve.conf
vim svnserve.conf [general] anon-access = none auth-access = write password-db = passwd authz-db = authz
vim passwd [users] hj = hj@
[groups] admin = hj,ye
[test:/] @admim =rw
启动svn
svnserve -d -r /data/svn/
windows client
svn://192.168.1.240/test 注意: 新增加问价需要add 操作,不然无法识别。
linux client
yum -y install mod_dav_svn subversion svn checkout svn://192.168.1.240/test add file # svn add aa.txt # svn commit aa.txt -m "its ok"
svn backup
1 svnadmin dump /data/svn/gm > gm_bak
2 tar -czvf conf.tar.gz conf
3 rsync -avz gm_bak conf.tar.gz 192.168.1.241:/data/svn
ssh 192.168.1.241
svnadmin create /data/svn/gm
svnadmin load /data/svn/gm < /data/svn/gm_bak
tar xf conf.tar.gz
mv conf /data/svn/gm/
svnserver -d -r /data/svn
svnadmin dump 增量备份
svnadmin dump 增量备份 上一次备份到版本14,现在要从版本15开始备份 svnadmin dump /data/svn/gm -r 15:19 --incremental > 2.bak rsync -avz 2.bak 192.168.1.241:/data/svn/ [root@centos svn]# svnadmin dump /data/svn/gm -r 15:19 --incremental > 2.bak * Dumped revision 15. * Dumped revision 16. * Dumped revision 17. * Dumped revision 18. * Dumped revision 19. 还原 [root@slave svn]# svnadmin load /data/svn/gm < /data/svn/2.bak <<< Started new transaction, based on original revision 15 * adding path : 高性能MySQL(第2版)中文版.pdf ... done. ------- Committed revision 15 >>> <<< Started new transaction, based on original revision 16 * adding path : 《JavaScript 语言参考》中文版.chm ... done. ------- Committed revision 16 >>> <<< Started new transaction, based on original revision 17 * deleting path : b.txt ... done. * deleting path : test ... done. * deleting path : test.php ... done. ------- Committed revision 17 >>> <<< Started new transaction, based on original revision 18 * adding path : angel 配置.doc ... done. * adding path : angelweb.sql ... done. ------- Committed revision 18 >>> <<< Started new transaction, based on original revision 19 * adding path : a.jpg ... done. ------- Committed revision 19 >>>