sh.sh
pidlist=ps -ef |grep fast-1.0-SNAPSHOT.jar |grep -v "grep"|awk '{print $2}'
for id in id
echo "kill -9 $id"
done
echo "--done--"
cd /root/project/fast
nohup /usr/local/java/jdk1.8.0_171/bin/java -jar fast-1.0-SNAPSHOT.jar >> nohup.out 2>&1 &
crontab
打开定时器设置:crontab -e
新增参数(8点50分执行脚本文件):50 08 * * * sh /root/project/fast/sh.sh
网友评论