在执行 shell输入框中加入BUILD_ID=dontKillMe
,即可防止jenkins杀死启动的进程
1 export BUILD_ID=dontKillMe 2 PROJECT_LOCATION="/usr/local/project/" 3 HOST=$HOST 4 5 6 7 8 9 rsync -avz --delete --progress --exclude "config*" --exclude "db" ${WORKSPACE}/ root@${HOST}:$PROJECT_LOCATION 10 11 ssh -tt root@${HOST} " 12 cd $PROJECT_LOCATION 13 14 15 nohup ./server >server.log 2>&1 & 16 sleep 10 17 exit 18 19 "