你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux 日志轮替

[日期:2012-06-21] 来源:Linux社区  作者:initphp [字体:大 中 小]
#日志轮替默认子Cron里面进行 
/etc/cron.daily/logrotate 
#日志文件依赖配置文件 
/etc/logrotate.conf 
 
#配置文件详细内容解读 
weekly  #默认每周进行一次日志清理 
rotate 10 #保留的日志文件 
# create new (empty) log files after rotating old ones 
create  #创建一个新的来存储 
# 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 -- we'll rotate them here 
/var/log/wtmp {  #针对单个wtmp日志操作 
    monthly    #每个月一次 
    minsize 1M    #超过1M整理 
    create 0664 root utmp  #新加文件权限和用户组 
    rotate 1  #保留一个文件 
}  linux
相关资讯       Linux使用教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款