Changeset 18872 for trunk/DataCheck/Transfer
- Timestamp:
- 05/21/17 10:34:57 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Transfer/ZipRawData.sh
r18853 r18872 1 1 #!/bin/bash 2 2 3 # this script has been written to run on La Palma on the machine data3 # this script has been written to run on La Palma on the machine newdata 4 4 # i.e. paths are only working on this machine 5 5 6 # to use script with /data1 instead of /scratch 7 # (e.g. when /scratch is full) 8 # export data1=yes 9 # before executing the script 6 10 source `dirname $0`/../Sourcefile.sh 7 11 printprocesslog "INFO starting "$0 … … 27 31 fi 28 32 33 rsynctempdir=/data1/rsync_tmp 34 if ! [ -d $rsynctempdir ] 35 then 36 mkdir $rsynctempdir 37 fi 38 29 39 # not needed anymore as ftools are not used anymore 30 40 ## setup to use ftools … … 38 48 do 39 49 echo "" >> $logfile 2>&1 40 rawdir=/scratch/raw/$date 50 if [ "$data1" = "yes" ] 51 then 52 rawdir=/data1/raw/$date 53 printprocesslog "INFO using "$rawdir" as input" 54 else 55 rawdir=/scratch/raw/$date 56 fi 41 57 echo `date`": processing files in "$rawdir >> $logfile 2>&1 42 58 printprocesslog "INFO processing files in "$rawdir … … 98 114 fi 99 115 116 printprocesslog "INFO process file "$file 117 if [ "$certaindate" != "" ] 118 then 119 echo "INFO process file "$file 120 fi 100 121 # first rsync from /scratch to /data1 101 file2=`echo $file | sed -e 's/scratch/data1/'` 102 if ! rsync -au -T $rsynctempdir $file $file2 103 then 104 printprocesslog "ERROR something went wrong with rsync of "$file 105 rm $file2 106 continue 107 fi 108 122 if [ "$data1" != "yes" ] 123 then 124 file2=`echo $file | sed -e 's/scratch/data1/'` 125 if ! rsync -au -T $rsynctempdir $file $file2 126 then 127 printprocesslog "ERROR something went wrong with rsync of "$file 128 rm $file2 129 continue 130 fi 131 fi 132 # copying to /data2 109 133 iszipped=`echo $file | grep -o fz` 110 134 if [ "$iszipped" == "fz" ] … … 114 138 115 139 # filename for file on data 116 zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' ` 117 zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits.fz/fits.fz.tmp/'` 118 140 if [ "$data1" = "yes" ] 141 then 142 zipfile=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' ` 143 zipfiletmp=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' -e 's/fits.fz/fits.fz.tmp/'` 144 else 145 zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' ` 146 zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits.fz/fits.fz.tmp/'` 147 fi 119 148 # check if file on data already exists 120 149 if [ -e $zipfile ] … … 152 181 153 182 # filename for temporary and final zipfile 154 zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'` 155 zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'` 183 if [ "$data1" = "yes" ] 184 then 185 zipfile=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'` 186 zipfiletmp=`echo $file | sed -e 's/data1/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'` 187 else 188 zipfile=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'` 189 zipfiletmp=`echo $file | sed -e 's/scratch/data2/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'` 190 fi 156 191 157 192 # check if zipped file already exists
Note:
See TracChangeset
for help on using the changeset viewer.