#! /bin/ksh ## ############################################################################### ## Script Name: chk_files_userprocs ## Where : in $FEDIR/scripts where FEDIR=/apps/nns_com/fea ## ############################################################################### ## Purpose: Checks sgia (or some other Unix machine) ## every 30 secs (or so) to see userids & process-IDs using the ## typical NNS SGI file systems -- /usr/people, /apps, /data, etc. -- ## 'local' to the processor. ## ## An input parameter specifies the sleep time between inquiries. ## If not provided, the default is 30 seconds. ############################################################################### ## Called by: $HOME/.auxchestrc or, eventually, ## feamain -> feautils.menu -> hostvu.menu script ## in $FEDIR/scripts ## ############################################################################### ## Call format: winterm -hold -t chk_files_userprocs -n chk_filuserprocs \ ## -e "rsh sgia $FEDIR/scripts/chk_files_userprocs 30" ## ############################################################################### ## Written by: B.Montandon O05 3Dec98 ## Updated by: " O05 2Feb99 Added script name to top ## date-line of display ## ############################################################################### # set -x if test "$1" = "" then DELAYSECS=30 else DELAYSECS=$1 fi FILSYSLIST=`df -l | tail +2l | awk '{print $7}'` while : do echo " ... `hostname` ......... `date` ................ FileSystems and their associated processes (from 'fuser -cu ') checking every $DELAYSECS seconds via $0 " echo " The process is using the file: c as its current directory. t as its text file. o as an open file. m as a mapped file, requested by mmap(2) or exec(2) in the case of dynamic shared libraries. r as its root directory, which was set up by the chroot(1M) command. y as its controlling terminal. a as its trace file located in the /proc directory. " for filsys in $FILSYSLIST do # fuser -cu $filsys fuser -cu $filsys 2>&1 | fold -s -w70 # ps -p `fuser -cuq $filsys 2> /dev/null` # sleep 1 echo " ........................................................................." done sleep $DELAYSECS done