home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / nn.tar / nn-6.5.1 / nnspew.sh < prev    next >
Text File  |  1995-04-29  |  564b  |  22 lines

  1. # nnspew -- generate subject line database
  2. #
  3. # From: James A. Woods (ames!jaw), NASA Ames Research Center
  4. #
  5. # Updates the auxiliary 'subjects' file.  It must be activated regularly
  6. # via a system-wide 'cron' or 'at' command, e.g.
  7. #
  8. #     2 6,9,12,15,18,21 * * *  root /bin/nice /usr/lib/nn/nnspew
  9.  
  10. trap "rm -f $TMP/nnsubj$$* ; exit" 0 1 2 15
  11.  
  12. # We use a "secret" 'nn -SPEW' call to do the hard part:
  13.  
  14. if $BIN/nn -SPEW < /dev/null > $TMP/nnsubj$$a
  15. then
  16.     if sort -u $TMP/nnsubj$$a > $TMP/nnsubj$$b
  17.     then
  18.         mv $TMP/nnsubj$$b $DB/subjects
  19.         chmod 644 $DB/subjects
  20.     fi
  21. fi
  22.