Although, I am pretty sure that there is a way to get Linux to delete the log files hourly, I have not figured it out yet. This is what my logrotate.conf in the /etc directory looks like. The parts in bold is what I entered and/or changed. I am currently using CentOS 5.2 Linux.
The reason I am doing this is because there is a problem. I keep getting this error message.
Dec 10 18:58:17 localhost kernel: atkbd.c: Unknown key pressed (translated set 2, code 0x8d on isa0060/serio0).
Dec 10 18:58:17 localhost kernel: atkbd.c: Use ‘setkeycodes e00d <keycode>’ to make it known.
Although it is in the background and cannot be seen, it is quickly eating up my hard drive space with a massive log file.
For those who are curious, the two line error message is about 241 bytes in total and it will take up about 9.9289 megabytes (abbreviated as M or MB). This is calculated daily with the assumption that there are 86 400 seconds in a day and the computer is on 24 hours.
The logrotate.conf file details
# see “man logrotate” for details
# rotate log files weekly
#changed from weekly to daily and added size 1M
daily
size 1M
# keep 4 weeks worth of backlogs
rotate 0
# 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
#changed monthly to daily and minsize to size
/var/log/wtmp {
daily
size 1M
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.