Ignore:
Timestamp:
08/04/08 13:41:17 (16 years ago)
Author:
snruegam
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles

    r8682 r9081  
    2121#   Author(s): Stefan Ruegamer 02/2007 <mailto:snruegam@astro.uni-wuerzburg.de>
    2222#
    23 #   Copyright: MAGIC Software Development, 2000-2007
     23#   Copyright: MAGIC Software Development, 2000-2008
    2424#
    2525#
     
    5050# change permission for files
    5151ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1
    52 # output for chmod with -v or -c (only changes)
    53 
    54 # outdated, .finished files are no longer used
    55 #printprocesslog "INFO moving directories from fromlapalma to fromtape"
    56 # find directories which have to be copied
    57 #dirs=`ls /magic/datacenter/fromlapalma/RAWchk/*/*.finished | sed -e 's/RAWchk/RAW/g' | cut -d/ -f1-6`
    58 #if [ ! "$dirs" == "" ]
    59 #then
    60    # change permission for this directories
    61    #ssh lapalma@dc09 chmod -R g+w $dirs >> $scriptlog 2>&1
    62    # move directories to the tapedirectory
    63    #mv -v $dirs /magic/datacenter/fromtape/rawdata/ >> $scriptlog 2>&1
    64 #fi
    6552
    6653printprocesslog "INFO moving directories from muxdata to rawdata"
     
    7360fi
    7461
    75 
    7662# find rawfiles
    77 rawfiles=`find /magic/datacenter/fromtape/rawdata/ -name '*.*'`
     63rawfiles=`find /magic/{datacenter,data/rawfiles}/fromtape/*data/ -regextype posix-egrep -regex '.*/20[01][0-9]{5}_(M[12]_)?[0-9]{8}(\.[0-9]{3})?_.*.raw' -type f`
    7864
    7965if [ "$rawfiles" == "" ]
     
    8874# workaround for rawfiles with wrong timing
    8975#   newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles-wrong-timing/g' -e 's/_/\//1' -e 's/_/\//1'`
    90    newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'`
     76   path=`dirname $rawfile | cut -d/ -f3`
     77   if [ "$path" == "datacenter" ]
     78   then
     79      newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'`
     80   elif [ "$path" == "data" ]
     81   then
     82      newrawfile=`echo $rawfile | sed -e 's/\/fromtape\/muxdata//g' -e 's/_/\//1' -e 's/_/\//1'`
     83   else
     84      echo "ERROR something is wrong with the path of file $rawfile -> continue" >> $scriptlog 2>&1
     85      printprocesslog "ERROR moving rawfile $rawfile failed"
     86      continue
     87   fi
     88   
    9189   newdir=`dirname $newrawfile`
    9290   makedir $newdir >> $scriptlog 2>&1
     
    9593done
    9694
    97 rmdir -v /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1
     95rmdir -v /magic/{datacenter,data/rawfiles}/fromtape/*data/* >> $scriptlog 2>&1
    9896
    9997printprocesslog "INFO launching filesondisk"
    10098echo "launching filesondisk" >> $scriptlog 2>&1
    101 $scriptspath/filesondisk&
     99$scriptspath/filesondisk &
    102100
    103101finish >> $scriptlog 2>&1
    104 
Note: See TracChangeset for help on using the changeset viewer.