BlueXIII's Blog

热爱技术,持续学习

0%

简易服务重启脚本

Crontab脚本

1
2
3
crontab -e

*/5 * * * * . /etc/profile; . ~/.bash_profile; isfound=$(ps -ef | grep "qixin-entrance-v2021.07.13.jar" | grep -v "grep"); if [ -z "$isfound" ]; then echo "$(date): restart qixin-entrance-v2021.07.13.jar...">>/var/log/restart.log && cd /opt/soft/enterprisedata && ./startup.sh; fi