Ignore:
Timestamp:
02/19/09 21:22:19 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8685 r9355  
    4343umask 0002
    4444
    45 scriptlog=$runlogpath/$program-$datetime.log
    46 date >> $scriptlog 2>&1
    47 
    4845# check whether script is already running
    4946lockfile=$lockpath/lock-$program.txt
    50 checklock  >> $scriptlog 2>&1
     47checklock
    5148
    5249# change permission for files
    53 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1
    54 ssh lapalma@dc09 chmod -R g+w /magic/datacenter/fromlapalma/RAW*/ >> $scriptlog 2>&1
     50ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/*
     51ssh lapalma@dc09 chmod -R g+w /magic/datacenter/fromlapalma/RAW*/
    5552# output for chmod with -v or -c (only changes)
    5653
     
    6158then
    6259   # change permission for this directories
    63    ssh lapalma@dc09 chmod -R g+w $dirs >> $scriptlog 2>&1
     60   ssh lapalma@dc09 chmod -R g+w $dirs
    6461   # move directories to the tapedirectory
    6562   dates=`find /magic/datacenter/fromlapalma/RAW/*200* -type d | cut -d/ -f6`
    6663   for date in ${dates[@]}
    6764   do
    68         ssh lapalma@dc09 mkdir /magic/datacenter/fromlapalma/RAWchk/$date >> $scriptlog 2>&1
    69         makedir /magic/datacenter/fromtape/rawdata/$date >> $scriptlog 2>&1
     65        ssh lapalma@dc09 mkdir /magic/datacenter/fromlapalma/RAWchk/$date
     66        makedir /magic/datacenter/fromtape/rawdata/$date
    7067       
    7168        OKs=`ls /magic/datacenter/fromlapalma/RAW/$date/*.OK`
    7269        for OK in ${OKs[@]}
    7370        do
    74                 ssh lapalma@dc09 mv -v $OK /magic/datacenter/fromlapalma/RAWchk/$date/ >> $scriptlog 2>&1
     71                ssh lapalma@dc09 mv -v $OK /magic/datacenter/fromlapalma/RAWchk/$date/
    7572                files=`echo $OK | sed -e 's/.OK//g'`
    76                 mv -v $files /magic/datacenter/fromtape/rawdata/$date/ >> $scriptlog 2>&1
     73                mv -v $files /magic/datacenter/fromtape/rawdata/$date/
    7774        done
    7875   done
    7976fi
    8077
    81 rmdir -v /magic/datacenter/fromlapalma/RAW/*200* >> $scriptlog 2>&1
     78rmdir -v /magic/datacenter/fromlapalma/RAW/*200*
    8279
    8380# find rawfiles
     
    8683if [ "$rawfiles" == "" ]
    8784then
    88    echo "no files to move -> exit" >> $scriptlog 2>&1
    89    finish >> $scriptlog 2>&1
     85   printprocesslog "INFO no files to move -> exit"
     86   finish
    9087fi
    9188
     
    9794   newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'`
    9895   newdir=`dirname $newrawfile`
    99    makedir $newdir >> $scriptlog 2>&1
     96   makedir $newdir
    10097   
    101    mv -v $rawfile $newrawfile >> $scriptlog 2>&1
     98   mv -v $rawfile $newrawfile
    10299done
    103100
    104 rmdir -v /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1
     101rmdir -v /magic/datacenter/fromtape/rawdata/*
    105102
    106103printprocesslog "INFO launching filesondisk"
    107 echo "launching filesondisk" >> $scriptlog 2>&1
    108104$scriptspath/filesondisk&
    109105
    110 finish >> $scriptlog 2>&1
     106finish
    111107
Note: See TracChangeset for help on using the changeset viewer.