#! /bin/csh
# tarraw - C shell script to tar raw mooring data into .tar.gz files
#	Note - this script then moves the raw files into directory
#	    ./raw/erase.  The intent is to allow ops/TSD folks to
#	    inspect the *.dir files to make sure everything is tar'd
#	    OK, and then erase the raw files from ./raw/erase.  It does
#	    this rather than rm'ing the files in order to allow recovery
#	    from script/system errors.
#

set oasis = /oasis
set nonomatch

foreach mooring (m1 m2)
    cd $oasis/raw/tar
    if ( -e $mooring.tar.gz ) \
	/usr/mbari/bin/gunzip $mooring.tar.gz >& /dev/null
    cd $oasis/raw
    tar rvf tar/$mooring.tar $mooring.* >& /dev/null
    mv $mooring.* erase
    cd $oasis/raw/tar
    tar tvf $mooring.tar >& $mooring.dir
    /usr/mbari/bin/gzip $mooring.tar >& /dev/null
#   rcp $mooring.tar.gz nautilus:/ARCHIVE/oasis/1995/1999
end
