home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / CNEWS / _CNEWS.TAR / usr / lib / newsbin / spacefor < prev   
Encoding:
Text File  |  1994-09-02  |  1.2 KB  |  32 lines

  1. #! /bin/sh
  2. # spacefor - determine available disk space
  3. # About how many things of $1 bytes will fit in the available space for
  4. # stuff of type $2 ("incoming", "articles", "control", "outbound $3",
  5. # or "archive") without cramping things too badly?
  6. #
  7. # You'll have to change this -- your blocksize and minimum-free-desired 
  8. # amounts will probably differ, and you may need to name filesystems
  9. # explicitly.  Note that all amounts are expressed in
  10. # target-filesystem blocks, not some arbitrary absolute unit.  (Absolute
  11. # units might be better but there is no agreement on what they should be.)
  12.  
  13. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  14. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  15.  
  16. PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  17. umask $NEWSUMASK
  18.  
  19. # file to look at, free blocks desired, and free inodes desired
  20. est=
  21. case "$2" in
  22. incoming)    arg="$NEWSARTS/in.coming" ; blocks=5000 ; inodes=1000    ;;
  23. articles)    arg="$NEWSARTS" ; blocks=5000 ; inodes=1000 ; est='-e 3000' ;;
  24. control)    arg="$NEWSCTL" ; blocks=3000 ; inodes=100        ;;
  25. outbound)    arg="/usr/spool/uucp" ; blocks=10000 ; inodes=1000    ;;
  26. archive)    arg="$NEWSARTS" ; blocks=1 ; inodes=1 ; est='-e 3000'    ;;
  27. *)        echo "$0: bad type argument \`$2'!!" >&2
  28.         exit 2 ;;
  29. esac
  30.  
  31. exec dostatfs $est $1 $arg $blocks $inodes
  32.