shell 间隔时间执行命令

客户现网性能问题严重,出下策,每间隔段时间对tomcat进程做thread dump,观察是否有死锁线程。shell 脚本

 

[root@localhost shellScript]# vi kill3.sh

echo 'useage:kill3.sh <pid> <interval>senconds <count>'
echo pid:$1
echo interval:$2
echo count:$3
echo ========please wait=======
i=1
while(($i<=$3))
do
  echo current running: $i
  kill -3 $1
  sleep $2
  i=$(($i+1))
done
echo =========all done success==============

 

 

你可能感兴趣的:(shell)