svn钩子

#!/bin/sh
#修改为服务编码
export.UTF-8

#Set variable
REPOS="$1"
REV="$2"

#svn安装脚本目录
SVN=/usr/bin/svn
#这里设置为你的网站的根目录
WEB=/www/web/music
#日志存放文件
LOG=/www/log/svnLog/first.txt

#update the code from the SVN
#demo是用户名 123456是密码
$SVN update $WEB --username carrot --password pwd666666 --non-interactive

chmod 755 -R $WEB
chown -R www.www $WEB

#......................
if [ $? == 0 ]
then

    echo  "$REPOS" "$REV" >> $LOG
    echo `date` >> $LOG
    echo "##############################" >> $LOG
fi
posted @ 2017-04-13 18:39  杨广伟9527  阅读(217)  评论(0编辑  收藏  举报