svn同步至web目錄

洋蔥土豆隨心匠發表於2017-07-25

#!/bin/sh
#設定環境變數,如果沒有設定可能會出現update報錯
export LANG=zh_CN.UTF-8
REPOS="$1"
REV="$2"
SVN_PATH=/usr/bin/svn
WEB_PATH=/web/project
LOG_PATH=/tmp/svn_update.log
#/usr/bin/svn update --username user --password password $WEB_PATH --no-auth-cache
echo "nnn##########開始提交 " `date "+%Y-%m-%d %H:%M:%S"` '##################' >> $LOG_PATH
echo `whoami`,$REPOS,$REV >> $LOG_PATH
$SVN_PATH update --username user --password password $WEB_PATH --no-auth-cache >> $LOG_PATH
chown -R www:www $WEB_PATH

相關文章