Files
ppgo_job/kill_process.sh
郝大全 4d8e647523 新增任务分类,杀死进程等
常驻任务和定时任务
常驻任务暂停时杀死进程
2017-06-30 15:49:33 +08:00

14 lines
418 B
Bash
Executable File

#!/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