svn钩子同步代码

#!/bin/sh
export LANG=en_US.UTF-8
PATH=/usr/bin
SVN=$PATH/svn
SVN_LOGIN_INFO=”–username ***** –password ********”
#SVN_LOG=/var/log/svn/${DATE}-svn.log
SVN_SRC=/opt/code_src/shop-yun/
WEB_SRC=/opt/www-data/shop-yun/
RSYNC=/$PATH/rsync
DATE=`/bin/date +%Y%m%d`

# svn update
${SVN} update ${SVN_LOGIN_INFO} ${SVN_SRC}

# rsync to web from src
${RSYNC} -aH –delete –progress –exclude=”.svn/,conf/app.ini” ${SVN_SRC} ${WEB_SRC} >> /var/log/rsync-self.log.$DATE
/bin/chown -R www-data:www-data ${WEB_SRC}
${RSYNC} -avzuP –exclude-from=/opt/code/shop-yun/hooks/rsync_admin_list.conf ${WEB_SRC} root@63.***.**.**::website >> /var/log/rsync-svn.log.$DATE

发表回复