I have the following lines in my /etc/logrotate.conf file which I'm not quite sure what they do:
(Edited in to show full file)
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 52 weeks worth of backlogs
rotate 52 # <-- added it by me
# 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 {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
You may want to refer to the logrotate man pages however;
/var/log/wtmp
- the file that is to be processedmonthly
- process the file the first time logrotate runs each month.minsize 1M
- The file has to be larger than minsize bytes before it will be processedcreate ...
- The new log file will be created with these permissions and owner/grouprotate 1
- the file will only be rotated once so only one earlier version of the file will be kept.Putting it all together
The first time logrotate runs each month, check the size of the /var/log/wtmp file and if it is larger than 1M bytes rotate it. If an earlier version of the file exists, delete the earlier version. Create a new /var/log/wtmp file owned by root of group utmp with permissions 0644.
Edit:
The wtmp file stores the login and logout information for your system. See the wtmp man page for more information.