日志切割配置文件详解

  • A+
所属分类:运维教程

logrotate

日志切割

/etc/logrotate.conf

配置文件

/etc/logrotate.d/

切割配置

logrotate

选项:

-v

详细信息

-f

强制

配置文件详解:

weekly

每周切割一次

rotate 4

保留四份

create

新文件的产生形式:创建

dateext

命名形式:日期

#compress

是否压缩:注释为不压缩

include /etc/logrotate.d

独立配置文件目录

/var/log/wtmp {

独立切割文件设置

    monthly

每月一次

    create 0664 root utmp

创建文件权限为664,所有者root,所有组utmp 

        minsize 1M

最小切割限制为1m 

    rotate 1

保留一份

} 

/var/log/btmp {

独立切割文件设置

    missingok

允许该文件不存在

    monthly

每月一次

    create 0600 root utmp

创建文件权限为600,所有者root,所有组utm 

    rotate 1

保留一份

}

命令格式:

logrotate /etc/logrotate.conf

  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:30   其中:访客  30   博主  0

    • avatar check my blog

      Do you mind if I quote a few of your articles as long as I provide credit and sources back to your webpage? My blog site is in the exact same area of interest as yours and my visitors would definitely benefit from some of the information you present here. Please let me know if this alright with you. Cheers!

      • avatar grolyrto lemcs

        I have not checked in here for some time as I thought it was getting boring, but the last several posts are good quality so I guess I?¦ll add you back to my everyday bloglist. You deserve it my friend :)

        • avatar methandienone

          Some genuinely interesting details you have written.Aided me a lot, just what I was searching for : D.

          • avatar cbd oil that works 2020

            Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit my comment
            didn’t appear. Grrrr… well I’m not writing all that over again.
            Regardless, just wanted to say excellent blog!

            • avatar hop over to here

              I’d have to examine with you here. Which is not one thing I usually do! I take pleasure in reading a post that may make folks think. Additionally, thanks for permitting me to comment!

              • I’ve read a few good stuff here. Certainly worth bookmarking for revisiting.
                I surprise how so much attempt you place to create the sort of magnificent informative site.

                • avatar tinyurl.com

                  Great article.

                  • Cbd oil that works 2020
                    Hello there! This blog post couldn’t be written any better!
                    Looking through this article reminds me of my previous roommate!
                    He constantly kept preaching about this. I will send this article to him.
                    Fairly certain he will have a very good read.

                    Thanks for sharing! best cbd oil for pain http://tinyurl.com/cbd-oil-that-works-2020 cbd oil
                    that works 2020 http://tinyurl.com/cbd-oil-that-works-2020

                    • avatar my link

                      Today, while I was at work, my cousin stole my apple ipad and tested to see if it can survive a 30 foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is totally off topic but I had to share it with someone!

                      • avatar g rsacwgxy

                        If some one wants to be updated with hottest technologies afterward he must be
                        visit this website and be up to date every day.