Changeset 17108 for trunk


Ignore:
Timestamp:
09/06/13 17:39:52 (11 years ago)
Author:
Daniela Dorner
Message:
adapted for usage of rsync servers, removed not needed check of stop times
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/QuickLook/Step1.sh

    r17003 r17108  
    77datepath=`date --date="-19HOUR" +%Y/%m/%d`
    88date=`date --date="-19HOUR" +%Y%m%d`
    9 #datepath="2013/07/13"
    10 #date="20130713"
     9# for processing by hand
     10#datepath="2013/08/11"
     11#date="20130811"
    1112printprocesslog "INFO processing "$datepath
    1213night=`echo $datepath | sed -e 's/\///g'`
     
    5152   then
    5253      printprocesslog "INFO rsync "$1
    53       #if ! rsync -av --stats $1 $2
    54       #if ! rsync -av $1 $2
    55       if ! rsync -a -T $rsynctempdir $1 $2
     54      # rsync
     55      #   from newdaq (/newdaq = /fact on newdaq), rsync server newdaq::newdaq/
     56      #   to daq (/daq = /loc_data on daq)
     57      rsyncservernewdaq=`echo $1 | sed -e 's/^\//172.16.100.100::/'`
     58      # old
     59      #if ! rsync -a -T $rsynctempdir $1 $2
     60      # new (workaround for problems on daq)
     61      if ! rsync -a -T $rsynctempdir $rsyncservernewdaq $2
    5662      then
    5763         printprocesslog "WARN rsync of "$1" failed."
     
    112118      printprocesslog "processing "$file
    113119      localfile=`echo $file | sed -e 's/newdaq/loc_data/'`
    114       #echo "processing "$file" "$localfile
    115 
    116       if [ "`echo $file | grep -o drs`" == "drs" ]
    117       then
    118          nondrsfile=`echo $file | sed -e 's/[.]drs//g'`
    119          tstop=`$factpath/fitsdump -h $nondrsfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
    120       else
    121          tstop=`$factpath/fitsdump -h $file  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
    122       fi
    123       if [ "$tstop" == "0" ]
    124       then
    125          printprocesslog "WARN "$file" not yet closed."
    126          fileaccessed=`find $file -amin -30`
    127          if ! [ "$fileaccessed" == "" ]
    128          then
    129             printprocesslog "INFO "$file" was accessed in the last 30 minutes => continue"
    130             continue
    131          else
    132             printprocesslog "WARN: "$file" has empty TSTOP but was not touched for 30 minutes"
    133             fileerror="yes"
    134          fi
    135       fi
    136120
    137121      source `dirname $0`/../Sourcefile.sh
     122      # check if file is already transferred
    138123      if ! ls $localfile >/dev/null 2>&1
    139124      then
    140          #if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile
    141          if ! rsync -a -T $rsynctempdir --bwlimit=$bwlimit $file $localfile
     125         # check if it is drs-file
     126         #   get stop time from raw-file
     127         if [ "`echo $file | grep -o drs`" == "drs" ]
     128         then
     129            nondrsfile=`echo $file | sed -e 's/[.]drs//g'`
     130            tstop=`$factpath/fitsdump -h $nondrsfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
     131         else
     132            tstop=`$factpath/fitsdump -h $file  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
     133         fi
     134         # when stop time is 0, file is not closed
     135         if [ "$tstop" == "0" ]
     136         then
     137            printprocesslog "WARN "$file" not yet closed."
     138            # if a file is not closed and not touched for 30 minutes,
     139            #    it is assumed corrupted and still transferred
     140            fileaccessed=`find $file -amin -30`
     141            if ! [ "$fileaccessed" == "" ]
     142            then
     143               printprocesslog "INFO "$file" was accessed in the last 30 minutes => continue"
     144               continue
     145            else
     146               printprocesslog "WARN: "$file" has empty TSTOP but was not touched for 30 minutes"
     147               fileerror="yes"
     148            fi
     149         fi
     150
     151         # rsync
     152         #   from newdaq (/newdaq = /fact on newdaq), rsync server newdaq::newdaq/
     153         #   to daq (/daq = /loc_data on daq)
     154         # to access rsync server via the dedicated network between
     155         #    daq and newdaq, use 172.16.100.100::newdaq
     156         filersyncserver=`echo $file | sed -e 's/^\//172.16.100.100::/'`
     157         # old
     158         ##if ! rsync -av --stats --progress --bwlimit=$bwlimit $file $localfile
     159         #if ! rsync -a -T $rsynctempdir --bwlimit=$bwlimit $file $localfile
     160         # new
     161         if ! rsync -a -W -T $rsynctempdir --bwlimit=$bwlimit $filersyncserver $localfile
    142162         then
    143163            printprocesslog "ERROR something went wrong with rsync of "$file
Note: See TracChangeset for help on using the changeset viewer.