[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Kill all your users



On 12/12/06, David Trask <dtrask 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]