Changeset 12621 for trunk/DataCheck/ZipRawData.sh
- Timestamp:
- 11/23/11 05:40:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/ZipRawData.sh
r12582 r12621 14 14 echo "" >> $logfile 2>&1 15 15 rawdir=/loc_data/raw/$date 16 echo `date`": processing files in "$rawdir >> $logfile 16 echo `date`": processing files in "$rawdir >> $logfile 2>&1 17 17 # check if data are available from that night 18 18 if ! [ -d $rawdir ] 19 19 then 20 echo `date`": no data available in "$rawdir >> $logfile 20 echo `date`": no data available in "$rawdir >> $logfile 2>&1 21 21 continue 22 22 fi … … 25 25 then 26 26 # create output directory for zip 27 mkdir -pv $zipdir >> $logfile 27 mkdir -pv $zipdir >> $logfile 2>&1 28 28 fi 29 29 30 30 # 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 32 32 fitsfiles=`find $rawdir -type f -name '*fits'| sort ` 33 33 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 34 40 # loop to zip files 35 echo `date`": zipping files in $rawdir..." >> $logfile 41 echo `date`": zipping files in $rawdir..." >> $logfile 2>&1 36 42 for file in $fitsfiles 37 43 do … … 49 55 if [ "$isnew" != "" ] 50 56 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 52 58 continue 53 59 fi … … 65 71 then 66 72 # 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 68 74 continue 69 75 fi 70 76 else 71 77 # 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 73 79 fi 74 80 75 echo `date`": zipping "$file" to "$zipfile" ..." >> $logfile 81 echo `date`": zipping "$file" to "$zipfile" ..." >> $logfile 2>&1 76 82 # zip file to stdout and pipe it to outputfile 77 83 if pigz -1 -c -f $file > $zipfiletmp; 78 84 then 79 85 # if successful, move temporary to final zipfile 80 mv -v $zipfiletmp $zipfile >> $logfile 86 mv -v $zipfiletmp $zipfile >> $logfile 2>&1 81 87 else 82 88 # if not successful, remove temporary zipfile 83 rm -v $zipfiletmp >> $logfile 89 rm -v $zipfiletmp >> $logfile 2>&1 84 90 fi 85 91 done 86 92 done 93 echo "finished zipping..." >> $logfile 2>&1 87 94 88
Note:
See TracChangeset
for help on using the changeset viewer.