- 把旧的日志文件移动并改名,同时创建一个新的空日志文件用来记录新日志,当旧日志文件超出保存的范围时就删除
- 统一配置默认缺省值 /etc/logrotate.conf
- # rotate log files weekly
- weekly
- # keep 4 weeks worth of backlogs
- rotate 4
- # create new (empty) log files after rotating old ones
- create
- # use date as a suffix of the rotated file
- dateext(日志转储文件会用日期来作为后缀,如secure-20130605)
- # uncomment this if you want your log files compressed
- #compress
- # rotate log files weekly
- 分别配置/etc/logrotate.d/
- daily毎天
- weekly每周
- monthly每月
- rotate数字 保留的日志文件的个数。0指没有备份
- compress 对旧的日志进行压缩
- delaycompress 转储的日志文件到下一次转储时才压缩
- create mode owner group建立新日志,同时指定新日志的权限与所有者和所属组.如create 0600 root utmp
- mail address当进行日志
logrotate日志转储
最新推荐文章于 2023-12-16 15:13:37 发布