I have a 14G root partition with /usr and other large dirs split out to other partitions. I was having big problems with the root device filling up. Finally I started searching around to find where all the space is going and I find this in my home directory.
$ ll -trSa | tail
-rw------- 1 ben users 2.4G 2008-05-19 17:13 .xsession-errors
$ tail .xsession-errors > .xsession-errors
Problem solved. This file was filled with trivial errors like "received an error processing data from the DCOP server!".
I bet I'm not the only one who has had this happen. I'm going to add it to my logrotate to prevent it from happening in the future. I guess this should teach me not to keep /home on the same partition as /.
How long have you been running your system. Maybe you should try to solve those errors. I am running my system for 8 Month now and .xsession-errors is only 12K big.
Do you have an example of log rotation configuration for such a beast? I would think some trickery will be necessary in the postrotate script, because logrotate is run as root, yet .xsession-errors has to be owned by you. I would also think that there would be some problems if you stay logged in during the logrotation, because I'm not sure if X is ready to receive a signal to reopen the .xsession-errors logfile. If you simply run log rotation, X will continue logging to the old inode. But in the meantime, logrotate will have renamed and gzipped it, so the inode will be orphaned. what was supposed to keep going into .xsession-errors will likely go into the bit-bucket. (actually an anonymous file, to be recovered on the next mount or fsck.) Not being logged in during logrotate would solve the latter problem, but the postrotate script will clearly have to handle the former.
Plus, if .xsession-errors is on a networked filesystem your problems are probably even worse, because root has usually has no authority there. (see root_squash on NFS, for instance.)
@Anarcho: When I redo my partitions I am going to do it that way. You are right, it makes things much easier.
@Depontius: Very interesting, I didn't think about that. Would something like: `tail .xsession-errors > .xsession-errors` work or does that make a new inode as well?