I got a notice from a backup system (rsnapshot) today that it's storage volume was full. A closer look reveals some older snapshots where faillog
, tallylog
and lastlog
are bigger than the actual filesystem they are on (/var
is a 6G partition).
-rw-r--r-- 3 root root 65G Feb 11 08:33 faillog
-rw------- 3 root root 129G Feb 11 08:33 tallylog
-rw-rw-r-- 2 root utmp 585G Feb 11 08:57 lastlog
Redhat says this is normal. Any way to limit the size on these? Can they be safely rotated every few hours?
du
orls -s
to determine actual file size. The number shown byls -l
is not the file size, but the file length, which don't match for sparse files.-l
is the short forlisting
format.ls -l
was "long format" not listing format, and the man page agrees. You could usels -ls
and get both size and length at once.man lastlog
saysThe 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".