#! /bin/csh # gettest - C Shell script to download data from OASIS controller on Test Can # and extract the data # set oasis = /usr/local/oasis/test set can = m1a set tncaddr = "mbari-7 v mbari-2" set cfgfile = /usr/local/oasis/test/cfg/m1a.cfg set bin = /usr/local/oasis/bin cd $oasis/raw set noclobber set noglob set datafilebase = `date +%y%j` set failmail = hebo@mbari.org set i = 0 set datafile = $can.$datafilebase.00 while ( -e $datafile ) @ i++ set datafile = $can.$datafilebase.`printf "%02d" $i` end set errorfile = $oasis/M1/error/$datafile $bin/getoasis -a "$tncaddr" >& $datafile set rtnsts = $status if ( $rtnsts ) then mailx -s "Failed OASIS Download" $failmail << ! Download failure of file $datafile Return code was $rtnsts `date` ! endif if ( (-e $datafile) && !(-z $datafile) ) then $bin/extract -c $cfgfile $datafile >& $errorfile endif if ( -z $errorfile ) \ rm -f $errorfile