Killing Idle Users

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

Killing Idle Users

Postby linuxgeek » Sat Aug 10, 2002 10:42 am

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:

Postby fawad » Sat Aug 10, 2002 7:48 pm

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:

Postby linuxgeek » Sat Aug 10, 2002 8:07 pm

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?

Postby animal » Mon Oct 21, 2002 5:50 pm

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


Return to “Administration”

Who is online

Users browsing this forum: No registered users and 1 guest