新增任务分类,杀死进程等
常驻任务和定时任务 常驻任务暂停时杀死进程
This commit is contained in:
14
kill_process.sh
Executable file
14
kill_process.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# @Author: haodaquan
|
||||
# @Date: 2017-06-29 17:44:45
|
||||
# @Last Modified by: haodaquan
|
||||
# @Last Modified time: 2017-06-29 17:44:45
|
||||
|
||||
process_tag=$1
|
||||
arrproc=$(ps -ef | grep "${process_tag}" | grep -v grep | awk '{print $2}')
|
||||
for p in $arrproc; do
|
||||
if [ "${p}"=~^[0-9]+$ ]; then
|
||||
kill -9 "${p}"
|
||||
echo `date "+%Y/%m/%d %H:%M:%S> "` ${p} " 进程已杀死!"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user