#!/bin/bash #This script generates new date file names for each data type #and then copies the file into the *work* directory tree. #This script will be replace by the script that goes to #each instrument computer and places the data into the *work* tree #Set the path export PATH=$HOME/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin echo " Start MakeData.bash `date -u`" #Check that USB disk is mounted. #If it is then procede #Else exit with error code #get the USB disk mount point read diskpath < $HOME/search/diskpath if [ -d "$diskpath"/search ]; then echo " "making data else echo " "USB disk "$diskpath" not mounted exit 1 fi cd $HOME/search/dmc read deltadate < newdate.txt newdate=`getymd $deltadate` let deltadate=deltadate+1 echo $deltadate > newdate.txt for d in hsrl mwrad do echo " "making data for $d in dmc cd $d for f in *.date.* do g=`echo $f | sed "s/date/$newdate/"` echo " "new file name $g cp $f $HOME/search/work/"$d"/"$g" done cd .. done for d in mom spc do echo " "making data for $d in dmc cd $d for f in *.date.* do g=`echo $f | sed "s/date/$newdate/"` echo " "new file name $g cp $f $HOME/search/work/mmcr/"$d"/"$g" done cd .. done echo " Stop MakeData.bash `date -u`"