Path: utzoo!attcan!uunet!shelby!apple!lamc!kdavis From: kdavis@lamc.UUCP (Ken Davis) Newsgroups: comp.sys.att,u3b.misc Subject: Info-3b2 Digest, Number 84 Message-ID: <202010@lamc.UUCP> Date: 19 May 89 13:53:07 GMT Reply-To: kdavis@lamc.UUCP (Ken Davis) Organization: Letterman Army Medical Center - San Francisco, CA Lines: 93 Info-3b2 Digest, Number 84 Friday, May 19th 1989 Today's Topics: idledaemon ---------------------------------------------------------------------- Subject: idledaemon From: info-3b2@netsys.COM Date: Fri, 19 May 89 00:56:16 -0400 Date: Thu, 18 May 89 11:19 CDT From: sysop@killer.Dallas.TX.US (Charles Boykin-BBS Admin) Len, Here is one - it can be modified to suit. It does work well. Charlie ------------------------- # idletime.sh - Idle job kill demon # will kill all jobs idle longer than 15 minutes # mail a message to the offender and log this # deed into /etc/idle.log umask 077 set `who -u | awk '{print $1,$2,$3,$4,$5,$6,$7}'` while true do name=$1 linetty=$2 month=$3 day=$4 logtime=$5 idle=$6 pid=$7 if [ $idle != "." ] then if [ `echo $idle | cut -c3-4` -gt 15 ] then echo $name $linetty $month $day $logtime $idle $pid >> /etc/idle.log mail $name <