ppt汇精美ppt模板免费下载网站,个人主页网站制作,系统优化app最新版,加强网站建设 通知服务器上某个进程杀掉后会重启#xff0c;怀疑是被当成肉鸡#xff0c;因此是用linux自带的crontab定时执行脚本杀掉进程
上传脚本文件到服务器
#! /bin/bash
# 要杀掉进程的名称
APPLICATIONntoolsif pkill -f ${APPLICATION}; thenecho ${…服务器上某个进程杀掉后会重启怀疑是被当成肉鸡因此是用linux自带的crontab定时执行脚本杀掉进程
上传脚本文件到服务器
#! /bin/bash
# 要杀掉进程的名称
APPLICATIONntoolsif pkill -f ${APPLICATION}; thenecho ${APPLICATION} stopped successfully
elseecho ${APPLICATION} is already stopped or not found
fi
给文件付可执行权限
chmod x kill_ntools配置/etc/crontab每分钟执行一次
SHELL/bin/bash
PATH/sbin:/bin:/usr/sbin:/usr/bin
MAILTOroot# For details see man 4 crontabs# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
* * * * * root /home/kill_ntools.sh