记录jenkins查看日志的方法
看不清图片的可以点击这里
cd /mnt/sdc/test/$project/logs
ls -l
rm -rf /clf/*
echo "" > /root/clf.log
grep -rl $start_day /mnt/sdc/test/$project/logs | xargs -i unzip -jo {} -d /clf
for i in `ls /clf`;
do
grep -n $start_time /clf/$i | head -1 | awk -F '[:]' '{print $1}' >> /clf/1.txt
grep -n $stop_time /clf/$i | head -1 | awk -F '[:]' '{print $1}' >> /clf/2.txt
for x in `cat /clf/1.txt`;
do
for y in `cat /clf/2.txt`;
do
sed -n "$x,$y"p $i >> /root/clf.log
done
done
done
cat /root/clf.log
本文来自博客园,作者:六月OvO,转载请注明原文链接:https://www.cnblogs.com/chenlifan/p/16350785.html