1
2
3
4
|
sed -n '/2021-02-13 21:00:00/,/2021-02-13 22:00:00/p' /usr/local/apache-tomcat-6.0.45/logs/crm.log > /opt/crm-`date +%Y-%m-%d-%H-%M`.log
截取某个时间段到某个时间段的日志
sed -n '/2021-01-18 21:10:00/,$p' /usr/local/apache-tomcat-6.0.45/logs/crm.log > /opt/crm-`date +%Y-%m-%d-%H-%M`.log
截取某个时间段到现在的
|