Killing Idle Users

Taking care of your Linux box.
Locked
linuxgeek
Site Admin
Posts: 195
Joined: Wed Aug 07, 2002 8:00 pm
Location: Multan, Pakistan
Contact:

Killing Idle Users

Post by linuxgeek »

Hi there,


Here is a script for killing idle users after a 10 hr mark!
------- cut here ----------

who -u | cut -c 1-10,39-50 | grep 10: > current
for each IDLE_USR ( `cat current | awk '{print $3}'` )
kill -9 $IDLE_USR
end
exit (0)

------- cut here ----------

Enjoy

--uppal
Junaid Saeed Uppal
uppal at linux dot net dot pk
Cell : +92.345.8586045
fawad
Site Admin
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
Location: Addison, IL
Contact:

Post by fawad »

Probably not a good thing to do in general use. The user could be compiling a kernel etc, so might have left the session running.
linuxgeek
Site Admin
Posts: 195
Joined: Wed Aug 07, 2002 8:00 pm
Location: Multan, Pakistan
Contact:

Post by linuxgeek »

fawad wrote:Probably not a good thing to do in general use. The user could be compiling a kernel etc, so might have left the session running.

Umm.. just for servers where you give free shell accounts .. or to kick off users who do idling
Junaid Saeed Uppal
uppal at linux dot net dot pk
Cell : +92.345.8586045
animal

huh?

Post by animal »

you ain't need any script. just get a gun n kill those bastardz!!!!
Locked