5 kx # /etc/logrotate.conf
5 kx #
5 kx # logrotate is designed to ease administration of systems that generate large
5 kx # numbers of log files. It allows automatic rotation, compression, removal, and
5 kx # mailing of log files. Each log file may be handled daily, weekly, monthly, or
5 kx # when it grows too large.
5 kx #
5 kx # logrotate is normally run daily from root's crontab.
5 kx #
5 kx # For more details, see "man logrotate".
5 kx
5 kx # rotate log files weekly:
5 kx weekly
5 kx
5 kx # keep 4 weeks worth of backlogs:
5 kx rotate 4
5 kx
5 kx # create new (empty) log files after rotating old ones:
5 kx create
5 kx
5 kx # don't rotate empty log files
5 kx notifempty
5 kx
5 kx # uncomment if you want to use the date as a suffix of the rotated file
5 kx #dateext
5 kx
5 kx # uncomment this if you want your log files compressed:
5 kx #compress
5 kx
5 kx # uncomment this to put rotated logs in "oldlogs" subdir
5 kx # this is relative to the original dir of the to-be-rotated file
5 kx # You can use a full path here, but beware of identically-named
5 kx # logfiles in different directories, e.g. httpd logs
5 kx #olddir oldlogs
5 kx
5 kx # some packages install log rotation information in this directory:
5 kx include /etc/logrotate.d
5 kx
5 kx # Rotate /var/log/wtmp:
5 kx /var/log/wtmp {
5 kx monthly
5 kx create 0664 root utmp
5 kx minsize 1M
5 kx rotate 1
5 kx }
5 kx
5 kx # Rotate /var/log/btmp:
5 kx /var/log/btmp {
5 kx monthly
5 kx create 0600 root root
5 kx rotate 1
5 kx }
5 kx
5 kx # Note that /var/log/lastlog is not rotated. This is intentional, and it should
5 kx # not be. The lastlog file is a database, and is also a sparse file that takes
5 kx # up much less space on the drive than it appears.
5 kx
5 kx # system-specific logs may be also be configured below: