# 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 <