Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!ncsuvx!ncsugn!emigh From: emigh@ncsugn.ncsu.edu (Ted H. Emigh) Newsgroups: comp.sys.att Subject: A modified diskuse (sysadm command) 3B2/SVR3 Message-ID: <3143@ncsugn.ncsu.edu> Date: 23 Mar 88 21:16:47 GMT Reply-To: emigh@ncsugn.UUCP (Ted H. Emigh) Organization: Genetics, North Carolina State University, Raleigh, NC Lines: 75 The following are my modifications to diskuse (in the sysadm menu system) to keep track of inodes as well as free space. You can use patch to apply the differences, or do it by hand. This is on our 3B2 with SVR3 -- I have no idea how general this is to the 3B series. --------------------------------------------------------------------------- *** /usr/admin/menu/filemgmt/original/diskuse Wed Feb 19 22:35:40 1986 --- /usr/admin/menu/filemgmt/diskuse Wed Mar 9 14:03:32 1988 *************** *** 10,18 echo " FILE SYSTEM USAGE AS OF" `date '+%m/%d/%y %T'` " ! File Free Total Percent ! System Blocks Blocks Full ! ------ ------ ------ -------" for fs in ${fslist} { eval `df -t ${fs} | --- 10,18 ----- echo " FILE SYSTEM USAGE AS OF" `date '+%m/%d/%y %T'` " ! File Free Total % Free Total % ! System Blocks Blocks Full I-nodes I-nodes Used ! ------ ------ ------ ----- ------- ------- ----" for fs in ${fslist} { eval `df -t ${fs} | *************** *** 16,23 for fs in ${fslist} { eval `df -t ${fs} | ! sed ' 1s/.*): *\([0-9]*\) .*/free=\1/ ! 2s/[^0-9]*\([0-9]*\) .*/total=\1/'` if [ "${total}" -gt 0 ] then percent=`expr \( ${total} - ${free} \) \* 100 / ${total}`% --- 16,23 ----- for fs in ${fslist} { eval `df -t ${fs} | ! sed ' 1s/.*): *\([0-9]*\) .*blocks *\([0-9]*\) .*/free=\1 ifr=\2/ ! 2s/.*total: *\([0-9]*\) .*blocks *\([0-9]*\) .*/total=\1 itot=\2/'` if [ "${total}" -gt 0 ] then percent=`expr \( ${total} - ${free} \) \* 100 / ${total}`% *************** *** 24,28 else percent= fi ! echo "${fs} ${free} ${total} ${percent}" } --- 24,34 ----- else percent= fi ! if [ "${itot}" -gt 0 ] ! then ! iper=`expr \( ${itot} - ${ifr} \) \* 100 / ${itot}`% ! else ! iper= ! fi ! echo "${fs} ${free} ${total} ${percent} ${ifr} ${itot} ${iper}" } --------------------------------------------------------------------------- -- Ted H. Emigh, Dept. Genetics and Statistics, NCSU, Raleigh, NC uucp: mcnc!ncsuvx!ncsugn!emigh internet: emigh%ncsugn.ncsu.edu BITNET: NEMIGH@TUCC @ncsuvx.ncsu.edu:emigh@ncsugn.ncsu.edu