Comment 16 for bug 60448

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote : Re: .xsession_errors file grows out of control & saturates disk space

Why not create a logrotate config file such as /etc/logrotate.d/xsession_errors with the following configuration:

"/home/*/.xsession_errors"
{
  rotate 1
  size 500k
  copytruncate
  missingok
  compress
}

It will check the file size daily and create one compressed copy whenever the file exceeds 500k, then remove the oldest copy and truncate .xsession_errors. to zero size.

I mean, why reinventing the wheel when we already have such a tool like logrotate.