Web Hosting Talk







View Full Version : quick ques


clocker1996
07-27-2002, 08:48 PM
Does anyone know how to do this via command line in linux?

If the process called 'yes' ( /usr/bin/yes ) takes up 90% of the cpu or more, kill -9 $THEPID-OF-THE-PROCESS will be executed.

I think this is possible without writing a perl script or anything.

Does anyone know how I could do this via command line?

clocker1996
07-27-2002, 08:52 PM
If not

How is it possible to ensure that the username 'bob' won't use more than 80% of the cpu

NO MORE than 80%

I know it must have something to do with limits.conf

Does anyone have any examples that they could show me? with cpu percentage

clocker1996
07-27-2002, 08:58 PM
I found something

ps -aux | grep yes | grep -v grep | awk '$3 > 90 { system("kill " $2) }'

that will kill it if its 90 or over i beleive (well i tested it, it works)

but if anyone would like to post other methods, or examples, feel free.

clocker1996
07-27-2002, 10:24 PM
oh my god

i just realized i posted this in the dedicated hosting forum
i'm sorry guys
i'm so out of it today
i did not realize at all

MOD please move this to tech forum
;\