Lastlog help!

Alan McKinnon alan at linuxholdings.co.za
Wed May 10 00:35:51 UTC 2006


On Tuesday 09 May 2006 20:54, David Walker wrote:
> I am working on an embedded system, and we're trying to preserve as
> much space as we possibly can.  I noticed a file /var/log/lastlog
> that is about 20megs of....well nothing much.  I was wondering if
> there is a simple way to limit the size of it, or make it so
> nothing (ssh) complains to auth.log that it can't write to
> /var/log/lastlog.

It's not as big as you think - the file is sparse. From man lastlog:

NOTE
       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 much 
smaller than the one shown by "ls
       -l" (which can indicate a really big file if you have a high 
UID). You can display its real size
       with "ls -s".

develop log # ls -al lastlog
-rw-r--r-- 1 root root 292876 2006-05-09 19:03 lastlog
develop log # ls -als lastlog
12 -rw-r--r-- 1 root root 292876 2006-05-09 19:03 lastlog

So mine appears to be 292k, but it's actually only 12k

-- 
If only me, you and dead people understand hex, 
how many people understand hex?

Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five




More information about the ubuntu-users mailing list