3

So... I discovered that my wtmp file was really big today, like 2.1GB.

I deleted it and recreated it, but...

Is there any way I can tell logrotate to well, rotate the log?

J. Polfer
  • 2,342

1 Answers1

4

Check man logrotate

Logrotate figures out which files need to be rotated based on the settings in /etc/logrotate.conf.

I think the default for wmtp is

/var/log/wtmp {
    monthly
    create 0664 root utmp
        minsize 1M
    rotate 1
}

If that's not in there, you can add it. If it's not sufficient, you can change it, or add a "size = whatever" directive to tell it to rotate whenever the size exceeds the set value.

Logrotate should be in the /etc/cron.daily. If it's not running often enough, you can call logrotate -f to force it.

Satanicpuppy
  • 7,205