#!/bin/bash #检测"API_NetDemo"进程运行时间超过10分钟就kill掉 #PS:是程序运行时间(即进程启动到现在的时间),不是占用cpu的时间 #Author by Qfeian function check_time() { time_subroutine=$(getconf CLK_TCK) start_time=$(awk
一个shell脚本,检测特定的程序,如果进程花费CPU运行的时间超过30分钟,就kill掉进程。脚本思路和写法相对简单,希望能起到抛砖引玉的作用。#!/bin/bash #author by Qfeian #Process name NAME="sendmail" for PID in `ps -A | grep "$NAME"|awk '{split($3,tab,/
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号