配置文件 /etc/logrotate.conf 
daily
  日志的轮替周期是每天
weekly
  日志的轮替周期是每周
monthly
  日志的轮替周期是每月
rotate 数字
  保留的日志文件的个数
compress
  日志轮替时旧的日志进行压缩
create mode owner group
  建立新日志,同时指定新日志的权限与所有者和所属组
mail address
  当日志轮替时,输出内容通过邮件发送到指定邮件地址
missingok
  如果日志不存在,则忽略该日志的警告信息
notifempty
  如果日志为空,则不进行日志轮替
minsize 数字
  日志一定要达到这个最小值才会轮替,否则就算时间到了也不轮替
size 数字
  日志只有大于指定大小才进行轮替,而不是按照时间轮替
dateext
  使用日期作为日志轮替文件的后缀

[root@localhost ~]# cat /etc/logrotate.conf
# see "man logrotate" for details
# 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

# 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 1
}

/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}

# system-specific logs may be also be configured here.
[root@localhost ~]#

logrotate [选项] /etc/logrotate.cong
  -v    显示日志轮替的过程
  -f     强制进行一次日志轮替,不论是否已经达到日志轮替的条件

最新文章

  1. Android中Activity运行时屏幕方向与显示方式详解
  2. C# 服务程序 - 调试服务
  3. 使用C#开发数据库应用系统
  4. 原生js操作dom备忘
  5. IE9下WebUploader上传图片跨域问题
  6. 远程登录linux不用输入密码的方法
  7. javascript 之Object内置对象
  8. css之让文字在一定范围内显示,不超过固定的宽度和高度
  9. 德州扑克AI实现 TexasHoldem Poker
  10. c 语言 结构体
  11. 一个伪ajax图片上传代码的例子
  12. Tomcat以指定JDK运行
  13. CenOS搭建FTP服务器
  14. github Travis CI 持续集成
  15. (并查集)POJ 1308 & HDU 1325
  16. php中一些提高性能的技巧
  17. linux安装OpenCV以及windows安装numpy、cv2等python2.7模块
  18. SQL Server中的标识列
  19. 小程序打开pdf
  20. 关于小程序登录时获取openId和unionId走过的坑

热门文章

  1. AngularJs学习笔记(1)——ng-app
  2. 自己学Docker:4.開始了解Docker的工作模式
  3. RandomForest 调参
  4. L​i​n​u​x​关​闭​防​火​墙​命​令
  5. 网页webbrowser
  6. DM36x IPNC OSD显示中文 --- 基础知识篇
  7. 学习笔记 - Unity是如何将你的项目发布到如此多的平台的?
  8. tuple 元组
  9. java中的static方法和实例方法区别
  10. library not found for -lPods-AFNetworking解决放案