#! /bin/csh # copydata - C Shell script to copy decoded OASIS data from # /usr/local/oasis/M[1,2] to /ARCHIVE/oasis/aug92/m[1,2] set nonomatch set today = `date -u +%y%j` set download = /usr/local/oasis set archive = /ARCHIVE/oasis/aug92 if ($#argv > 0) set today = $1 if ( $today % 1000 > 1 ) then @ yesterday = $today - 1 else @ year = $today / 1000 - 1 set day = 366 if ( $year % 4 ) set day = 365 set yesterday = $year$day endif foreach name (adcp atlas ctd ctd20 error gps oasis oasis.m1b par pco2 spectro spectro10 spectro20) cd $download/M1/$name foreach file (9*) if ( $file == '9*' ) continue if ( $file < $today - 7 ) then mv $file $archive/m1/$name else cp $file $archive/m1/$name endif end end foreach name (atlas ctd error gps oasis par) cd $download/M2/$name foreach file (9*) if ( $file == '9*' ) continue if ( $file < $today - 7 ) then mv $file $archive/m2/$name else cp $file $archive/m2/$name endif end end