[mythtv-users] Limit log file size?

Nick Morrott knowledgejunkie at gmail.com
Sun Dec 6 17:30:38 UTC 2009

2009/12/6 Mark Knecht <markknecht at gmail.com>:
> On Sun, Dec 6, 2009 at 6:15 AM, Nick Morrott <knowledgejunkie at gmail.com> wrote:
>> 2009/12/6 Mark Knecht <markknecht at gmail.com>:
>>> I'm not finding this when I search through the on-line docs. For the
>>> older 0.21 version how do I limit the size of the mythbackend.log
>>> file?
>>> I'd like to limit both the size, and if possible make it a little less verbose.
>>> The distro is Gentoo. I found the /etc/conf.d/mythbackend config file
>>> and set it to
>>> MYTH_VERBOSE="important,general"
>>> but it still seems a bit too much. Each recording and viewing is
>> Reduce that to 'important' only for even less output. However, I find
>> my backend/frontend logfile sizes irrelevant when rotated weekly.
>>> adding anywhere from 20 to 50 lines so it's stll going to grow sort of
>>> quickly. Is there a place I can limit overall file size?
>> Not within MythTV. One way to handle this is to use logrotate and have
>> the logfile rotated and compressed when it hits a particular size. I
>> keep 8 weeks of logs - looking at my compressed logs I see average
>> filesizes of 20KB for the frontend, and 50KB for the backend which
>> were generated from logs of approx 700KB and 250KB respectively.

My mistake - those last two filesizes are swapped around.

> Thanks Nick.
> OK, I see that either the Myth or Gentoo folks provided a logrotate
> file but it's not set up to rotate automatically so I'll have to learn
> how to do that. I suppose that's done with cron - another Linux app I
> know nothing much about?

Check your /etc/cron.*/ directories - you may find logrotate is
already configured.

On my old Fedora master backend, program-specific logrotate config
files are stored in /etc/logrotate.d/ and there is a logrotate entry
in the cron.daily directory, which runs with the default
/etc/logrotate.conf config. That in turn pulls in all of the
/etc/logrotate.d/ files which can override the default settings, which
includes whether to rotate the logs based on filesize or age.


Nick Morrott

MythTV Official wiki: http://mythtv.org/wiki/
MythTV users list archive: http://www.gossamer-threads.com/lists/mythtv/users

"An investment in knowledge always pays the best interest." - Benjamin Franklin

More information about the mythtv-users mailing list