#! /bin/csh # getm1a - C Shell script to download data from OASIS mooring at M1 # and extract the data # set oasis = /usr/local/oasis set can = m1a set tncaddr = "mbari-3 v mbari-2" 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 $oasis/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 $oasis/bin/extract $datafile >& $errorfile endif if ( -z $errorfile ) \ rm -f $errorfile