这几天公司须要统计svn的相关数据,最后发现了statsvn这个工具能够实现要求,因而就测试了下,感受还真的不错,为了能自动去生成一个库的统计,我就本身写了个超级简单的脚本,你们别见笑!!!!!!!!!!!!
#!/bin/bash
echo "Please enter the name of a library"
read library
mkdir /usr/local/apache2/htdocs/$library
svn checkout svn://10.10.1.64:4002/$library /usr/local/apache2/htdocs/tongji/$library --username xxx --password xxx
if [ $? = 0 ]
then
svn log --xml -v --username xxx --password xxx /usr/local/apache2/htdocs/tongji/$library >/usr/local/apache2/htdocs/tongji/$library/svn.log
if [ $? = 0 ]
then
java -jar /usr/local/apache2/htdocs/statsvn-0.7.0/statsvn.jar /usr/local/apache2/htdocs/tongji/$library/svn.log /usr/local/apache2/htdocs/tongji/$library -output-dir /usr/local/apache2/htdocs/$library
rm -rf /usr/local/apache2/htdocs/tongji/$library
else
exit 0
fi
else
exit 0
fi