ls and du disagreement
I wrote a script to do log rotation for a Weblogic Application.
The file is permanetly written to and grows fast. The filesystem size forbid to make a copy of the file.
Mainly the script in crontab does just this :
cat FILE | gzip > ARCHIVE && cat /dev/null > FILE
Now, ls and du show very different info :
ll FILE
-rw-r--r--1 weblogic web1740727500 Mar 21 10:53 FILE
This is the former size of the file before it was purge
du -k FILE
1824FILE
This should be it's real size
I tried a little C program based on <sys/stat.h>
lsinod FILE
File : FILE
inode 254713 on ufs filsystem with block_size of 8 ko
- rw- r-- r--UID=5000GID=500 Link(s) 1
1740728538 byte(s) 3648 block(s)
Last readed : Fri Mar 21 10:44:09 2003
Last writed : Fri Mar 21 10:53:27 2003
tail works find on FILE, head takes unusual time to complete
df -k on the filesystem shows the space occupied by the file was freed.
=> What would be you diagnostic ?

