java_linux_shell_定时kill 启动java程序
#!/bin/bash #
while true
do Process_ID=`ps -ef |grep 'LoginSinaWeiboCookie.jar' |grep -v grep |awk '{print $2}'` Cookie_DIR=/home/chenpenghui/crawler/LoginSinaWeiboCookie kill -9 $Process_ID cd $Cookie_DIR java -jar LoginSinaWeiboCookie.jar -Xmx256M sleep 12h
done
12小时,强行重启一次。
create by cphmvp
email:cphmvp@163.com
爬虫技术交流_crawler QQ群 :167047843