# jenkins部署后目录问题 cd /usr/share/nginx/html/ax-node # 授权 chmod u+x ./app # 获取当前nohup进程的pid nohup_pid=$(pgrep -f "nohup" | grep "./app") # 如果找到当前nohup进程 if [ -n "$nohup_pid" ]; then # 关闭当前nohup进程 kill -9 $nohup_pid fi # 获取当前时间 current_time=$(date +"%Y-%m-%d_%H:%M:%S") # 启动新的nohup进程 nohup ./app > "ax-node_$current_time.log" 2>&1 &