[mythtv] Database schema checker

ian dobson i.dobson at planet-ian.com
Sun Aug 31 07:53:39 UTC 2008


Try with the -r option :-
   -r Check recordings (from DB)
   -f Check files on fs
   -v Verbose
   -c Check Channels
   -a Enable all options
   -b Black/White output
   -H This text

The -f option checks files in the fs against the DB. The -r option checks 
the recorded DB against the file system. The option -a enables all checks 
maybe it's a good idea to use "|more" as it produces alot of output.

Ian Dobson

Home of the Atmel based UDP mobile web cam http://www.planet-ian.com
All mails scanned with av-filter.pl (F-Prot / perl)

----- Original Message ----- 
From: "Otto Kolsi" <otto at kolsi.fi>
To: "ian dobson" <i.dobson at planet-ian.com>
Sent: Sunday, August 31, 2008 9:27 AM
Subject: Re: [mythtv] Database schema checker

> Hello Ian!
> ian dobson wrote:
>> I've gone over to using DBI->connect_cached which reuses connections if 
>> their available, thanks for the tip.
> I think your script is very useful, thanks for working on it and sharing 
> it.
> I today tried it and noticed that the script does not find all the 
> mismatches related to files <-> DB. With command:
> "./CheckMythDB.pl -f -v"
> the script prints 13 files which exist in my LiveTV storagegroup in 
> filesystem:
> [--].Checking files in storage group 'LiveTV'
> [OK].File 1001_20080719202131.mpg storage group 'LiveTV' exists in 
> database
> ...
> But when I execute following query to DB, I get 19 as a result:
> "select count(*) from recorded where storagegroup = 'LiveTV'"
> So there are some orphaned entries in DB that do not have corresponding 
> files in fs. It would be nice to have the script to report these. Is this 
> a bug or have you not yet implemented this check?
> I'm not good at Perl at all, but I'd like to help with the script. At 
> least do some testing etc.
> Best Regards,
>   Otto 

More information about the mythtv-dev mailing list