A modified diskuse (sysadm command) 3B2/SVR3

Ted H. Emigh emigh at ncsugn.ncsu.edu
Thu Mar 24 07:16:47 AEST 1988


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 at TUCC                  @ncsuvx.ncsu.edu:emigh at ncsugn.ncsu.edu



More information about the Comp.sys.att mailing list