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
Killing Idle Users
-
- Site Admin
- Posts: 195
- Joined: Wed Aug 07, 2002 8:00 pm
- Location: Multan, Pakistan
- Contact:
Killing Idle Users
Junaid Saeed Uppal
uppal at linux dot net dot pk
Cell : +92.345.8586045
uppal at linux dot net dot pk
Cell : +92.345.8586045
-
- Site Admin
- Posts: 195
- Joined: Wed Aug 07, 2002 8:00 pm
- Location: Multan, Pakistan
- Contact:
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
uppal at linux dot net dot pk
Cell : +92.345.8586045