home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / doc / manual / volume1 / pp_nightly.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1990-09-20  |  942 b   |  47 lines

  1. #! /bin/sh
  2.  
  3. PATH=/crg/pp/bin:/crg/pp/cmds/tools:/usr/local/bin:/usr/ucb:/bin:/usr/bin:/usr/5bin:
  4. export PATH
  5. #
  6. # Shell script run nightly to collect up things etc.
  7. #
  8. set -x
  9. cd /crg/pp
  10. L=logs
  11. T=tables
  12. STATDIR=/crg/pp/logs/statistics
  13.  
  14. exec 1> $L/pp-nightly.log 2>&1
  15.  
  16. freespace . 2000 || { echo NO space left on device; exit 1; }
  17.  
  18. #Save the stats files
  19. if [ -f $L/stat ]
  20. then
  21.     DATE=`date +%h-%d.%T`
  22.     [ -d $L/tmp ] || mkdir $L/tmp
  23.     mv $L/stat $L/tmp/stat.$DATE
  24. fi
  25.  
  26. # And then once a week...
  27. if [ `date +%w` -eq 0 ]
  28. then
  29.     YDATE=`date "+%h-%d-%y`
  30.     [ -d $STATDIR ] || mkdir $STATDIR
  31.     if pstat $L/tmp/* /dev/null | bin/stat.awk > $STATDIR/stats.$YDATE
  32.     then
  33.         echo 'Sucessful - removing old files'
  34.         rm $L/tmp/*
  35.     fi
  36. fi
  37.  
  38. # This should be first building command, as it updates the DERFIL2 file
  39. echo 'building the PP tables'
  40. (cd tables; make install)
  41.  
  42. # update the niftp stuff
  43. echo 'building the niftp database'
  44. (cd niftp; make ) 
  45.  
  46. echo UPDATE complete
  47.