Create a rotation of /var/log/lastlog

Latest response

/var/log/lastlog is currently at 5Gb. Usually it creates a rotation automatically. I was wondering if and how to crate a rotation manually or delete?

Responses

Hi Ray,

There is neither need nor should lastlog be rotated.

Take a look at a very old bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=372

Your file is not actually 5GB. It is much smaller. Check it with, for exasmple:

# du -h /var/log/lastlog

or

# ls -s /var/log/lastlog

The on-line manual is also very clear about it:

The lastlog file is a database which contains info on the last login of each user. You should not rotate it. It is a sparse file, so its size on the disk is usually much smaller than the one shown by "ls -l" (which can indicate a really big file if you have in passwd users with a high UID). You can display its real size with "ls -s".

I hope this helps.

Best wishes,

Dusan Baljevic (amateur radio VK2COT)

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.