home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / expire / expireiflow < prev    next >
Text File  |  1994-08-17  |  592b  |  27 lines

  1. #! /bin/sh
  2. # expireiflow minmegabytes [ expireoptions ]
  3. # run doexpire -r if things are getting tight
  4. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  5. . ${NEWSCONFIG-/etc/news/bin/config}
  6.  
  7. case "$#" in
  8. 0)    echo "Usage: $0 minmegabytes [ expireoptions ]" >&2
  9.     exit 2
  10.     ;;
  11. esac
  12.  
  13. minimum=$1
  14. shift
  15.  
  16. PATH=$NEWSCTL/bin:$NEWSBIN/expire:$NEWSBIN:$NEWSPATH ; export PATH
  17. umask $NEWSUMASK
  18.  
  19. lock="$NEWSCTL/LOCKexpire"
  20.  
  21. if test " `spacefor 1024000 articles`" -lt $minimum -a ! -f $lock
  22. then
  23.     echo "space getting low in $NEWSARTS; running doexpire -r" |
  24.                     report "space low in $NEWSARTS"
  25.     exec doexpire -r $*
  26. fi
  27.