home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / util / sfcproto < prev    next >
Text File  |  1995-04-27  |  1KB  |  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. # "batchfiles", 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-/etc/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="/var/spool/uucp" ; blocks=10000 ; inodes=1000    ;;
  26. batchfiles)    arg="$NEWSARTS/out.going" ; blocks=5000 ; inodes=1000 ; est='-e 100000'    ;;
  27. archive)    arg="$NEWSARTS" ; blocks=1 ; inodes=1 ; est='-e 3000'    ;;
  28. *)        arg="$2" ; blocks=1 ; inodes=1 ; est='-e 3000'        ;;
  29. esac
  30.  
  31. exec dospacefor $est $1 $arg $blocks $inodes
  32.