[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Query about .xsession-errors file



On Mon, 15 Sep 2014 15:07:48 +0800
Bret Busby <bret.busby@gmail.com> wrote:

> On 15/09/2014, Chen Wei <weichen302@icloud.com> wrote:
> > On Tue, Sep 09, 2014 at 03:29:04PM +0800, Bret Busby wrote:
> >> .xsession-errors, which is currently sitting at about 740MB, and
> >> has been growing in the last hour.
> >>
> >> entries from before the current boot session) entries, so as to
> >> reduce the file size to content that is necessary to retain for
> >> debugging?
> >>
> >
> > If debugging is not required, redirect xsession error to /dev/null
> > is another option.
> >
> > in /etc/X11/Xsession, find the line:
> >
> > exec >>"$ERRFILE" 2>&1
> >
> > change it to:
> >
> > exec >>/dev/null 2>&1
> >
> > --
> > Chen Wei
> >
> >
> 
> Hello.
> 
> At this time, after doing what I had done, that I had previously
> stated, the file is still at zero bytes, so I think that it is
> probably better, to leave the error handling as it is, and, monitor it
> daily, to detect any change, and then, act on any changes to the file.
> 
> However, thank you for the suggestion, which I shall retain for future
> consideration.
> 
> 

If you do not want it to disappear altogether, you can just prune it. I
have this in my ¨/home/<user>/.bash_profile¨ file:

# prune the ~/.xsession-errors file if it grows beyond 1Mb
if [ $(du -b ~/.xsession-errors | cut -f1) -gt 1048576 ]; then
  KEEP_LINES="$(tail -n 100 ~/.xsession-errors)"
  echo "$KEEP_LINES" > ~/.xsession-errors
fi

Keeps it under control but still usable.

cheers,
greywolf


-- 
It is about the Dragons - it was always about the Dragons!


Reply to: