[mythtv-users] how to limit program database table ?

Michael T. Dean mtdean at thirdcontact.com
Mon Dec 31 14:08:29 UTC 2012


On 12/29/2012 07:53 PM, Martin Koller wrote:
> On Sunday 30 December 2012 01:28:59 Raymond Wagner wrote:
>> On 12/29/2012 19:07, Martin Koller wrote:
>>> Shouldn't mythtv at some point in time remove the old guide data from the db automatically ?
>>> If so, can I configure the period it keeps ?
>> MythTV should be deleting any program guide data more than seven days
>> old as part of its daily cleanup routine. In 0.25, that was increased to
>> ten days and made configurable, although doing so required tinkering in
>> the database.
>>
>> http://code.mythtv.org/cgit/mythtv/tree/mythtv/programs/mythbackend/housekeeper.cpp?h=fixes/0.23#n555
> Thanks a lot for the link.
> I think I found my problem - look at the content of the housekeeping table:
>
> mysql>  select * from housekeeping;
> +------------------------+---------------------+
> | tag                    | lastrun             |
> +------------------------+---------------------+
> | DailyCleanup           | 2013-02-03 21:10:19 |
> | JobQueueRecover-martin | 2013-02-03 22:26:03 |
> | MythFillDB             | 2012-12-29 06:48:33 |
> | LogClean               | 2013-02-03 21:55:44 |
> | BackupDB               | 2010-05-24 12:05:14 |
> | DBCleanup              | 2009-11-15 14:39:31 |
> +------------------------+---------------------+
>
> I remember that I had a broken battery in my server, and sometime after a new boot
> the clock was completely wrong ... therefore I seem to have dates in the future here!
>
> I already replaced the battery, so I hope when I correct these entries all things will
> work correctly again.
>
> P.S.:It would probably be a good idea to check for such a situation in the code,
> e.g. if the lastrun timestamp is in the future, issue at least a warning or
> simply ignore it, run the housekeeper job and store the current time.


FWIW, your best bet is not to correct the entries but to completely 
remove them.  Something as simple as TRUNCATE TABLE housekeeping; is 
fine.  There are more constraints on the values than simply being in the 
past, so unless you want to figure out those constraints...

Mike


More information about the mythtv-users mailing list