字體:小 中 大 | |
|
|
2019/04/16 16:37:38瀏覽540|回應0|推薦0 | |
以下為TOPAP主機判斷1440分鐘(24HR)執行刪除fglrun-bin 的script
排程時間
0 11 * * * sh /root/jacky/killpid/killpid.sh
Script內容
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ps -eo pid,bsdtime,cmd | grep fglrun-bin | awk -F":" '{ print $1 " " $2 }' | awk '$2 > 1440{print $1 " " $2 " " $5}' | cat >> /tmp/killpid/$(date +%Y%m%d).log
ps -eo pid,bsdtime,comm | grep fglrun-bin | awk -F":" '{ print $1 " " $2 }' | awk '$2 > 1440{print $1}' | xargs kill -9
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Log位置
/tmp/killpid
|
|
( 知識學習|其他 ) |