shell
#!/bin/sh if [ ! -x "files" ]; then mkdir source fi if [ ! -x "source" ]; then mkdir source fi if [ ! -x "target" ]; then mkdir target fi find ./source/ -type f |xargs rm -f find ./target/ -type f |xargs rm -f for file in `ls files` do ln -s `pwd`/files/$file /ogsapp/data/rev/*/ org=`echo $file|awk '{split($0, array, "-");print array[4]}' |awk '{split($0, array, ".");print array[1]}'` ./ftp.sh $1 $org echo $org sleep 15 find /ogsapp/data/txt/19/20131*/ -cmin -5 -name "*$2*.jf*" -exec cp -r {} `pwd`/target/ \; done #./run2.sh ./run.sh
pwd=`pwd` list=`ls $pwd/files/*` for file in $list do echo file= $file rand=`date +%s%N` echo rand= $rand rlen=`expr length $rand` echo rlen= $rlen len=`expr length $file` echo len = $len mv $file ${file:0:`expr $len - 7 - $rlen`}$rand.ORG.gz echo ${file:0:`expr $len - 7 - $rlen`}$rand.ORG.gz done echo "RNAME COMPLATE!" ln -s ${file:0:`expr $len - 7 - $rlen`}$rand.ORG.gz /ogsapp/data/rev/201307121230/ ls /ogsapp/data/rev/201307121230/*$rand.ORG.gz count=`ls /ogsapp/data/rev/201307121230/*$rand.ORG.gz | wc -l` for((;count>1;)); do count=`ls /ogsapp/data/rev/201307121230/*$rand.ORG.gz |wc -l` echo $count sleep 1 done ls /ogsapp/data/rev/201307121230/*$rand.ORG.gz echo "LN -S COMPLATE!" sleep 60 rm $pwd/target/* echo "rm target complate!" ls /ogsapp/data/txt/19/2013*/*/*/*$1*jf* -ltr | tail -n 1 | awk '{print $8$9}' lastfile=`ls /ogsapp/data/txt/19/2013*/*/*/*$1*jf* -ltr | tail -n 1 | awk '{print $9}'` echo "lastfile:" $lastfile cp $lastfile $pwd/target/ echo "copy complate!" #./confSource_p.sh $2 #echo "config source_p.awk complate!" ./run.sh echo "run complate!" more t1.log sz t1.target t1.source echo "down complate!"
posted on 2014-10-29 10:00 weiguoyuan 阅读(153) 评论(0) 收藏 举报
浙公网安备 33010602011771号