日志文件批量重命名

#!/bin/bash
#2015-08-12 ip_pool
=(`echo 10.20.34.{11..14}` `echo 10.142.194.{25..32}`) for ip in ${ip_pool[@]};do node=`ls /disk3/YH_DATA/DATA/mobile2.0/${ip}/pv` for n in ${node};do cd /disk3/YH_DATA/DATA/mobile2.0/${ip}/pv/${n} ls pv+2015*.log|sed "s/pv+\([^.]\+\)\(\.log\)/mv & clientpv+${n}+${ip}+\1\2/e" done done for ip in ${ip_pool[@]};do node=`ls /disk3/YH_DATA/DATA/mobile2.0/${ip}/info` for n in ${node};do cd /disk3/YH_DATA/DATA/mobile2.0/${ip}/info/${n} ls client+weblogicLogsName*+2015*.log|sed "s/client+\([^.]\+\)\(2015.*\.log\)/mv & client+${n}+${ip}+\2/e" done done for ip in ${ip_pool[@]};do node=`ls /disk3/YH_DATA/DATA/mobile2.0/${ip}/interface` for n in ${node};do cd /disk3/YH_DATA/DATA/mobile2.0/${ip}/interface/${n} ls client+2015*.log|sed "s/client+\([^.]\+\)\(\.log\)/mv & client+${n}+${ip}+\1\2/e" ls client-open+2015*.log|sed "s/client-open+\([^.]\+\)\(\.log\)/mv & client-open+${n}+${ip}+\1\2/e" done done

 

posted on 2015-08-12 17:45  K‘e0llm  阅读(282)  评论(0编辑  收藏  举报

导航