使用logrotate做nginx日志轮询
来源:互联网 发布:局域网行为监控软件 编辑:程序博客网 时间:2024/06/05 04:06
logrotate看名字就知道是专门做日志轮询的,只把任务配置放在/etc/logrotate.d/下,任务就会自动完成,而且无需安装,系统自带,比较推荐使用.
- [root@srv logrotate.d]# vi /etc/logrotate.d/nginx
[root@srv logrotate.d]# vi /etc/logrotate.d/nginx
配置如下
- /usr/local/nginx/logs/www.willko.cn.log /usr/local/nginx/logs/nginx_error.log {
- notifempty
- daily
- sharedscripts
- postrotate
- /bin/kill -USR1 `/bin/cat /usr/local/nginx/nginx.pid`
- endscript
- }
/usr/local/nginx/logs/www.willko.cn.log /usr/local/nginx/logs/nginx_error.log {
notifempty
daily
sharedscripts
postrotate
/bin/kill -USR1 `/bin/cat /usr/local/nginx/nginx.pid` endscript
}多个日志以空格分开, notifempty 如果日志为空则不做轮询 daily 每天执行一次 postrotate 日志轮询后执行的脚本 这样,每天都会自动轮询,生成nginx.log.1-n
- 使用logrotate做nginx日志轮询
- 使用logrotate做nginx日志轮询
- 使用logrotate做nginx日志分割
- 使用Logrotate分割Nginx日志
- linux:使用logrotate管理nginx日志文件
- 使用 logrotate 进行 nginx 日志分割
- nginx使用logrotate对日志进行分割
- 使用logrotate管理nginx日志文件
- linux 使用logrotate做日志轮替
- logrotate切割nginx日志
- logrotate 进行nginx日志分割
- logrotate切割日志之nginx
- 用logrotate拆分nginx日志
- logrotate 做日志收集处理
- 使用logrotate 管理日志文件
- logrotate管理分割nginx日志无效
- Nginx日志切割之Logrotate篇
- logstash 用 logrotate 来做日志切分
- 借助开源工具高效完成Java应用的运行分析
- 支持向量机: Maximum Margin Classifier
- 在main()之前,IAR都做了啥?
- 手机第一次发表
- C语言学习笔记(2)
- 使用logrotate做nginx日志轮询
- linux开启oracle服务的命令
- 业余无线电入门介绍
- Adapter 模式的小例子以及分析
- CDO大型应用开发框架CDOFramework 1.1.2发布了
- mjpg-streamer源码分析
- 操作系统 同步 司机与售票员
- ACE反应器(Reactor)模式
- 优化SQL查询:如何写出高性能SQL语句