码迷,mamicode.com
首页 > 其他好文 > 详细

使用logrotate实现日志轮训压缩

时间:2017-05-16 14:42:46      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:logrotate

技术分享

cat /etc/logrotate.d/nginx 

/opt/lamp/apache/logs/*.log {

su root root

daily

        rotate 14

        copytruncate

        compress

        notifempty

        missingok

        dateext

        postrotate

                 /usr/bin/killall -USR1 /opt/openresty/nginx/sbin/nginx

        endscript

}


本文出自 “silence” 博客,请务必保留此出处http://silencezone.blog.51cto.com/3613477/1926144

使用logrotate实现日志轮训压缩

标签:logrotate

原文地址:http://silencezone.blog.51cto.com/3613477/1926144

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!