文章标题
来源:互联网 发布:htc x9网络 编辑:程序博客网 时间:2024/05/23 00:39
!/bin/bash
baseDir=’/app/logs/moncollector1’
curDate=””
curTime=””
upTime=””
Info=0
Error=1
NotExit=2
获取error.log 的MD5值验证是否有新内容在更新
getMD5(){
md5sum $baseDir/error.log|awk '{print $1}'
}
get system time and date
getDateTime(){
curDate=date +%F
curTime=date +%H:%S:%M
}
get new data
getNewData(){
less $baseDir/error.log|grep ERROR
}
check error file md5
checkMD5(){
if [ -f $baseDir/error.log ] then md5_up=`getMD5` sleep 5s md5_down=`getMD5` if [ $md5_up == $md5_down ] then echo $Info else echo $Errot fi else echo $NotExit fi
}
findByWord(){
NewData=getNewData
echo $NewData >> tmp.log
cat tmp.log|grep ERROR
暂写到此
if [ ! -n $tmp ];then echo "OK" else echo $tmp fi
}
main(){
re_num=checkMD5
echo
1) echo “OK”;;
0) echo findByWord
;;
2) echo “NO,error.log not exit!”;;
*) exit;;
esac
}
res=main
echo $res
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- java中的NAN和INFINITY
- 如何查看Theano的TensorSharedVariable和TensorVariable变量
- 小程序scroll-view组件触发事件
- 文章标题
- SpringBoot创建maven多模块项目(实战)
- 文章标题
- VirtualBox 中 centos7 下 ping 命令出现 Network is unreachable 问题的解决方法
- 量化函数IBoll-布林带的策略实用
- [sentry源码阅读] event请求与写入过程初步剖析
- Appium-Android元素定位方式
- 洛谷 模板 树状数组
- 火狐position定位时用到margin-top:50%出错
- fastjson下对象转json时丢失属性的问题
- Spring Boot 入门笔记