首页 > 代码库 > linux logrotate 日志文件roll up

linux logrotate 日志文件roll up

log rotate


vi /etc/logrotate.d/spark :

/apps/svr/spark-1.1.1-bin-cdh4/logs/mercury-spark-span.log
{
    notifempty
    daily
    rotate 5
    compress
    olddir /apps/svr/spark-1.1.1-bin-cdh4/logs/
    missingok
    copytruncate
}

execute:
/usr/sbin/logrotate -f /etc/logrotate.d/spark

http://blog.csdn.net/cjwid/article/details/1690101

less command does work:
1. export LESSCHARSET=utf-8
2. export LESS=-Mrf

linux logrotate 日志文件roll up