新增任务分类,杀死进程等

常驻任务和定时任务
常驻任务暂停时杀死进程
This commit is contained in:
郝大全
2017-06-30 15:49:33 +08:00
parent fbd1f9e1a7
commit 4d8e647523
10 changed files with 160 additions and 17 deletions

14
kill_process.sh Executable file
View 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