Changeset 14840


Ignore:
Timestamp:
02/04/13 06:02:39 (12 years ago)
Author:
Daniela Dorner
Message:
adapted to new structure in LP (newdaq, new transfer scheme)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Transfer/ZipRawData.sh

    r14757 r14840  
    1010date >> $logfile
    1111
     12if ! ls /daq/raw >/dev/null 2>&1
     13then
     14   printprocesslog "ERROR /daq/raw is not available."
     15   finish
     16fi
    1217# get last 3, 6 or 9 nights
    1318dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
     
    2328        )
    2429
    25 # time rawfile is untouched before further processing (i.e. adding checksum and zipping)
    26 delaytime=30 #30 minutes
    27 
    2830# setup to use ftools
    2931source $HEADAS/headas-init.sh
     32
     33delaytime=5
    3034
    3135# do rsync for rawfiles of these dates
     
    3337do
    3438   echo "" >> $logfile 2>&1
    35    rawdir=/loc_data/raw/$date
     39   rawdir=/daq/raw/$date
    3640   echo `date`": processing files in "$rawdir >> $logfile 2>&1
    3741   printprocesslog "INFO processing files in "$rawdir
     
    6973   do
    7074      # 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/'`
    7377      # check if zipped file already exists
    7478      if [ -e $zipfile ]
     
    8690      fi
    8791
    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
    109114
    110115#      # update the raw file with the checksums
     
    133138         printprocesslog "INFO remove "$zipfiletmp"..."
    134139         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
    135148      fi
    136149   done
Note: See TracChangeset for help on using the changeset viewer.