[K12OSN] Kill all your users

Sudev Barar sbarar at gmail.com
Tue Dec 12 02:06:05 UTC 2006


On 12/12/06, David Trask <dtrask at vcsvikings.org> wrote:
> Kill 'em all!  (at the end of the day)  ;-)
>
> Here's how I do it.  I have a script called "stop" located in /usr/bin.
> It's designed originally to "kill" a single user, but I have taken that
> script and made another script that can be launched as a cron job to
> "purge" the server.  First the "stop" script....
>
> #!/bin/sh
> # usage  stop username
> # stop
> # script to logoff a student
> #
>
> if [ $1 != "root" ]
> then
>    for i in $(pgrep -u $1)
>    do
>       kill -9 $i
>    done
> else
>    clear
>    echo "Can't kill the root!!"
> fi
>
>

I'd rather leave a few UID's that are not killed by specifying UID's
above 1000 (we allot UID's below 1000 only to system people) so that
any screen or wget's running in background mode are not killed when
left for large downloads overnight.

-- 
Regards,
Sudev Barar




More information about the K12OSN mailing list