#!/bin/sh # # sub shell for plotwsys.sh: # runs gnuplot and creates html file for whole data set (since start) # # H.G.Berns (berns@phys.washington.edu), UW Seattle, 23 April 1999. homedir=/u/hans workdir=$homedir/watersys tempdir=$workdir/temp logdir=$workdir/log webdir=$homedir/public_html/watersys/day newweb=neutrino:public_html/watersys/day lastdata=$homedir/public_html/watersys/wsys.last gnuscript=$workdir/wsys_24h.gnu htmlfile=$webdir/index.html htmltemp=$webdir/wsys_temp.html logfile=$logdir/plot_24h.log datafile=wsys_24h.data starttime=`cat $webdir/$datafile | grep -v "#" | head -1 | awk '{print $1}'` endtime=`tail -1 $webdir/$datafile | awk '{print $1}'` updatetime=`tail -1 $lastdata | awk -F. '{print $1}'` cd $tempdir echo "`date`: run gnuplot over the 24-hour data file" > $logfile (/usr/bin/gnuplot $gnuscript) >> $logfile 2>&1 echo "`date`: convert pbm files to gif and move to webdir" >> $logfile htmltitle="K2K 1KT Watersystem Logs (last 24 hours)" echo "" > $htmltemp echo "$htmltitle" >> $htmltemp echo "

$htmltitle

" >> $htmltemp echo "
" >> $htmltemp echo "Please make sure the time stamps below are up to date!
" >> $htmltemp echo "If they are more than 2 hours behind current time, try a " >> $htmltemp echo "''Shift-Reload'' of the page." >> $htmltemp echo "

" >> $htmltemp echo "

data from $starttime until $endtime

" >> $htmltemp echo "last update $updatetime: " >> $htmltemp echo "converted data table
    " >> $htmltemp ppm2gif=/usr/bin/ppmtogif # ppm2gif=$workdir/ppmtogif for file in `ls *.pbm | awk -F. '{ print $1 }'` do echo "$file.pbm --> $file.gif" >> $logfile ($ppm2gif $file.pbm > $file.gif) >> $logfile 2>&1 mv $file.gif $webdir # scp -o Protocol=1 $webdir/$file.gif $newweb/ echo "
  1. \"$file\"

    " >> $htmltemp done rm *.pbm echo "


questions? please send comments to " >> $htmltemp echo "HGB @ " >> $htmltemp echo "UW, Seattle.

" >> $htmltemp echo "last automatic ftp/scan/plot: `date`" >> $htmltemp mv $htmltemp $htmlfile # scp -o Protocol=1 $htmlfile $newweb/index.html echo "`date`: done plotting 24-hour data set" >> $logfile