如何寫一個抓取top後 cpu超過70%的程式 … - Linux

By Audriana
at 2009-06-18T16:02
at 2009-06-18T16:02
Table of Contents
我後來辜到一個程式
網址連結:http://0rz.tw/S8dQb
轉貼如下:
當process CPU loading超過90%, 就先行刪除:
#!/bin/bash
CPULOADING=90
ps auxh | \
while read pro
do
set -- $pro
if [ `echo $3 | cut -d"." -f1` -gt $CPULOADING ]; then
kill $2
fi
done
後來想想 應該也滿合用的!把不合理過高的cpu使用量都kill掉!
不知道這支程式是否能如期正常運作?! 感謝指導。
--
網址連結:http://0rz.tw/S8dQb
轉貼如下:
當process CPU loading超過90%, 就先行刪除:
#!/bin/bash
CPULOADING=90
ps auxh | \
while read pro
do
set -- $pro
if [ `echo $3 | cut -d"." -f1` -gt $CPULOADING ]; then
kill $2
fi
done
後來想想 應該也滿合用的!把不合理過高的cpu使用量都kill掉!
不知道這支程式是否能如期正常運作?! 感謝指導。
--
Tags:
Linux
All Comments

By Ophelia
at 2009-06-23T02:26
at 2009-06-23T02:26

By Frederica
at 2009-06-27T14:47
at 2009-06-27T14:47

By Doris
at 2009-06-28T10:53
at 2009-06-28T10:53

By Adele
at 2009-07-01T11:33
at 2009-07-01T11:33

By Mia
at 2009-07-01T13:40
at 2009-07-01T13:40

By Edith
at 2009-07-02T02:47
at 2009-07-02T02:47
Related Posts
bash 字串擷取

By Frederica
at 2009-06-18T13:29
at 2009-06-18T13:29
firefox會有殘影@@~

By Thomas
at 2009-06-18T10:27
at 2009-06-18T10:27
Compile C++ in UNIX

By Rebecca
at 2009-06-18T09:28
at 2009-06-18T09:28
Linux上有動態歌詞的MP3播放器

By James
at 2009-06-18T09:26
at 2009-06-18T09:26
如何monitor kernel drivers' memory u …

By Doris
at 2009-06-18T00:43
at 2009-06-18T00:43