logrotate
来源:互联网 发布:知乎这么厉害? 编辑:程序博客网 时间:2024/05/22 12:39
linux中可以使用logrotate 用来进行日志的管理
logrotate的默认配置文件为 /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 9 weeks worth of backlogs
rotate 9
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 9
}
/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 9
}
# system-specific logs may be also be configured here.
注意到其中有一个 include,它包含了/etc/logrotate.d/目录
所以可以将自定义配置放入到该目录下
当系统(使用crontab)或者手动调用logrotate /etc/logrotate.conf 时候,会自动调用/etc/logrotate.d/目录下的所有配置文件,同时,该目录中的配置文件会继承到/etc/logrotate.conf 中的全局参数
而手动调用 logrotate /etc/logrotate.d/XXX 的时候, XXX并不能继承到 /etc/logrotate.conf 中定义的全局变量
- logrotate
- logrotate
- logrotate
- logrotate
- logrotate
- logrotate
- logrotate
- logrotate
- syslog & logrotate
- Logrotate使用说明
- linux logrotate
- 移植 logrotate
- linux logrotate
- logrotate使用
- logrotate使用
- Logrotate操作手册
- cat /etc/logrotate.conf
- 日志工具:logrotate
- Java中的AQS在Java6和Java7中的一点小不同
- s3c2410 linux 触摸屏驱动程序分析
- 进程间通信--共享内存
- jquery 之validate 笔记(转载)
- 对齐指令
- logrotate
- 深刻理解Linux进程间通信(IPC)
- 见到的一篇IOCP流程 自己用demo实现了一下, 简单照抄,改动了一点点
- php生成的csv, 无法完整显示带前导0的数字
- 触发器函数
- iPhone-NSAssert使用
- 网站变成黑白(网站变灰)的设置方法
- Linux环境进程间通信(一)管道及有名管道
- ajax 异步传输