Changeset 14840 for trunk/DataCheck/Transfer/ZipRawData.sh
- Timestamp:
- 02/04/13 06:02:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Transfer/ZipRawData.sh
r14757 r14840 10 10 date >> $logfile 11 11 12 if ! ls /daq/raw >/dev/null 2>&1 13 then 14 printprocesslog "ERROR /daq/raw is not available." 15 finish 16 fi 12 17 # get last 3, 6 or 9 nights 13 18 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \ … … 23 28 ) 24 29 25 # time rawfile is untouched before further processing (i.e. adding checksum and zipping)26 delaytime=30 #30 minutes27 28 30 # setup to use ftools 29 31 source $HEADAS/headas-init.sh 32 33 delaytime=5 30 34 31 35 # do rsync for rawfiles of these dates … … 33 37 do 34 38 echo "" >> $logfile 2>&1 35 rawdir=/ loc_data/raw/$date39 rawdir=/daq/raw/$date 36 40 echo `date`": processing files in "$rawdir >> $logfile 2>&1 37 41 printprocesslog "INFO processing files in "$rawdir … … 69 73 do 70 74 # filename for temporary and final zipfile 71 zipfile=`echo $file | sed -e 's/ raw/zipraw/' -e 's/fits/fits.gz/'`72 zipfiletmp=`echo $file | sed -e 's/ raw/zipraw/' -e 's/fits/fits.tmp.gz/'`75 zipfile=`echo $file | sed -e 's/daq/loc_data/g' -e 's/raw/zipraw/' -e 's/fits/fits.gz/'` 76 zipfiletmp=`echo $file | sed -e 's/daq/loc_data/g' -e 's/raw/zipraw/' -e 's/fits/fits.tmp.gz/'` 73 77 # check if zipped file already exists 74 78 if [ -e $zipfile ] … … 86 90 fi 87 91 88 # check if file is already finished 89 # original file on daq (if data was taken on daq 90 origfile=`echo $file | sed -e 's/loc_data/daq/'` 91 if [ -e $origfile ] 92 then 93 # get time of last modification as seconds since Epoch for both files 94 timeorig=`stat -c %Y $origfile` 95 timecopy=`stat -c %Y $file` 96 # compare times 97 if ! [ $timeorig -eq $timecopy ] 98 then 99 # if times are not the same, the file is still open => no zip 100 echo `date`": file "$file" not yet closed => continue" >> $logfile 2>&1 101 printprocesslog "WARN file "$file" not yet closed => continue" 102 continue 103 fi 104 else 105 # if the origfile doesn't exist, the data was probably written not on daq but on data 106 echo `date`": file "$file" was probably taken on data and not daq " >> $logfile 2>&1 107 printprocesslog "WARN file "$file" was probably taken on data and not daq " 108 fi 92 # not needed anymore, as only complete files are transferred from newdaq to daq 93 # # check if file is already finished 94 # # original file on daq (if data was taken on daq 95 # origfile=`echo $file | sed -e 's/loc_data/daq/'` 96 # if [ -e $origfile ] 97 # then 98 # # get time of last modification as seconds since Epoch for both files 99 # timeorig=`stat -c %Y $origfile` 100 # timecopy=`stat -c %Y $file` 101 # # compare times 102 # if ! [ $timeorig -eq $timecopy ] 103 # then 104 # # if times are not the same, the file is still open => no zip 105 # echo `date`": file "$file" not yet closed => continue" >> $logfile 2>&1 106 # printprocesslog "WARN file "$file" not yet closed => continue" 107 # continue 108 # fi 109 # else 110 # # if the origfile doesn't exist, the data was probably written not on daq but on data 111 # echo `date`": file "$file" was probably taken on data and not daq " >> $logfile 2>&1 112 # printprocesslog "WARN file "$file" was probably taken on data and not daq " 113 # fi 109 114 110 115 # # update the raw file with the checksums … … 133 138 printprocesslog "INFO remove "$zipfiletmp"..." 134 139 rm -v $zipfiletmp >> $logfile 2>&1 140 diskusage=( `df -P /loc_data | grep /loc_data ` ) 141 # check if more than ~ 10 GB are left on /loc_data 142 if [ ${diskusage[3]} -lt 10000000 ] 143 then 144 echo "WARN less than 10 GB left on /loc_data on data " 145 printprocesslog "WARN less than 10 GB left on /loc_data on data " 146 finish 147 fi 135 148 fi 136 149 done
Note:
See TracChangeset
for help on using the changeset viewer.