Ignore:
Timestamp:
11/23/11 05:40:28 (13 years ago)
Author:
Daniela Dorner
Message:
added some logging
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/ZipRawData.sh

    r12582 r12621  
    1414   echo "" >> $logfile 2>&1
    1515   rawdir=/loc_data/raw/$date
    16    echo `date`": processing files in "$rawdir >> $logfile
     16   echo `date`": processing files in "$rawdir >> $logfile 2>&1
    1717   # check if data are available from that night
    1818   if ! [ -d $rawdir ]
    1919   then
    20       echo `date`": no data available in "$rawdir >> $logfile
     20      echo `date`": no data available in "$rawdir >> $logfile 2>&1
    2121      continue
    2222   fi
     
    2525   then
    2626      # create output directory for zip
    27       mkdir -pv $zipdir >> $logfile
     27      mkdir -pv $zipdir >> $logfile 2>&1
    2828   fi
    2929
    3030   # find all fits-files starting with the oldest file
    31    echo `date`": finding files to be zipped in $rawdir..." >> $logfile
     31   echo `date`": finding files to be zipped in $rawdir..." >> $logfile 2>&1
    3232   fitsfiles=`find $rawdir -type f -name '*fits'| sort `
    3333
     34   if [ ${#fitsfiles[@]} -eq 0 ]
     35   then
     36      echo `date`": no files to be zipped in $rawdir..." >> $logfile 2>&1
     37      continue
     38   fi
     39
    3440   # loop to zip files
    35    echo `date`": zipping files in $rawdir..." >> $logfile
     41   echo `date`": zipping files in $rawdir..." >> $logfile 2>&1
    3642   for file in $fitsfiles
    3743   do
     
    4955      if [ "$isnew" != "" ]
    5056      then
    51          echo $file" is not older than 30 min => continue" >> $logfile
     57         echo $file" is not older than 30 min => continue" >> $logfile 2>&1
    5258         continue
    5359      fi
     
    6571         then
    6672            # if times are not the same, the file is still open => no zip
    67             echo `date`": file "$file" not yet closed => continue" >> $logfile
     73            echo `date`": file "$file" not yet closed => continue" >> $logfile 2>&1
    6874            continue
    6975         fi
    7076      else
    7177         # if the origfile doesn't exist, the data was probably written not on daq but on data
    72          echo `date`": file "$file" was probably taken on data and not daq " >> $logfile
     78         echo `date`": file "$file" was probably taken on data and not daq " >> $logfile 2>&1
    7379      fi
    7480
    75       echo `date`": zipping "$file" to "$zipfile" ..." >> $logfile
     81      echo `date`": zipping "$file" to "$zipfile" ..." >> $logfile 2>&1
    7682      # zip file to stdout and pipe it to outputfile
    7783      if pigz -1 -c -f $file > $zipfiletmp;
    7884      then
    7985         # if successful, move temporary to final zipfile
    80          mv -v $zipfiletmp $zipfile >> $logfile
     86         mv -v $zipfiletmp $zipfile >> $logfile 2>&1
    8187      else
    8288         # if not successful, remove temporary zipfile
    83          rm -v $zipfiletmp >> $logfile
     89         rm -v $zipfiletmp >> $logfile 2>&1
    8490      fi
    8591   done
    8692done
     93echo "finished zipping..." >> $logfile 2>&1
    8794
    88 
Note: See TracChangeset for help on using the changeset viewer.