emigh@ncsugn.ncsu.edu (Ted H. Emigh) (03/24/88)
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.edupjh@mccc.UUCP (Peter J. Holsberg) (03/24/88)
In article <3143@ncsugn.ncsu.edu> emigh@ncsugn.UUCP (Ted H. Emigh) writes: |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. Someone recently posted a Berkeley-style df program that runs very nicely on my 3b2 under SysV r3.0 v2. (Do I have enough e's in Berekeleye???) -- Peter Holsberg UUCP: {rutgers!}princeton!mccc!pjh Technology Division CompuServe: 70240,334 Mercer College GEnie: PJHOLSBERG Trenton, NJ 08690 Voice: 1-609-586-4800