Zookeeper可视化脚本


zkDir=/Users/hg/Software/zookeeper-3.4.10
filePath=/Users/hg/Software/zk12
jarPath=''

for tmpFile in $zkDir/*.jar $zkDir/lib/*.jar
do
 if test -f $tmpFile;then
jarPath=$tmpFile:$jarPath
fi
done
echo $jarPath

for tmpFile in $filePath/log.*
do
 if test -f $tmpFile;then
        #echo $tmpFile 是文件
if  [[ $tmpFile != *txt ]] ; then
echo $tmpFile
java -cp $jarPath org.apache.zookeeper.server.LogFormatter "$tmpFile" > ${tmpFile}.txt
fi
    fi
done


zkDir=/Users/hg/Software/zookeeper-3.4.10
filePath=/Users/hg/Software/zk12

for tmpFile in $zkDir/*.jar $zkDir/lib/*.jar
do
 if test -f $tmpFile;then
jarPath=$tmpFile:$jarPath
fi
done
echo $jarPath

for tmpFile in $filePath/snapshot.*
do
if test -f $tmpFile;then
# 是log文件
if  [[ $tmpFile != *txt ]] ; then
echo $tmpFile
java -cp $jarPath org.apache.zookeeper.server.SnapshotFormatter "$tmpFile" > $tmpFile.txt
fi
fi
done

你可能感兴趣的:(Zookeeper可视化脚本)