[mythtv-users] lost recordings and database orphans

Big Wave Dave bigwavedave at gmail.com
Wed Mar 24 05:48:03 UTC 2010


On Tue, Mar 23, 2010 at 10:45 PM, Big Wave Dave <bigwavedave at gmail.com> wrote:
> On Tue, Mar 23, 2010 at 9:27 PM, Greg Woods <greg at gregandeva.net> wrote:
>> I've got a problem that the old myth.find_orphans.pl script was supposed
>> to solve, but it no longer works:
>>
>> http://www.gossamer-threads.com/lists/mythtv/users/425156#425156
>>
>> What happened is that I lost a hard drive that had about 3/4 of my
>> recordings on it. I don't mind losing the recordings as much as the fact
>> that I now have a ton of entries in the database for recording files
>> that no longer exist. Aside from totally cluttering up the Watch
>> Recordings display, which is a major annoyance, even worse is that these
>> episodes will not re-record, because the database has recorded that I
>> already have them. There are over 600 lost recordings, so going through
>> the GUI and manually removing the ones that are missing would take days.
>> There has to be a better way.
>>
>> I would like to take a stab at cleaning up the database, but determining
>> all the interrelationships between the tables is probably a bit beyond
>> my SQL skills. Is there anyone who knows the database enough to at least
>> tell me which tables need to be modified? For example, I can find the
>> "basename" values in the "recorded" table and determine which entries in
>> this table correspond to missing files. I could probably even script
>> something that would check them and delete all the entries in this table
>> that correspond to missing files. But I will bet there are references in
>> other tables that point to the entries in this table and I will probably
>> hose things up royally if I just do that.
>>
>> Any ideas as to what I could do to clean up?
>>
>> I might even consider just removing all the remaining recordings too if
>> I knew which tables should be emptied out after that to get me to a
>> consistent state.
>>
>> Thank you,
>> --Greg
>>
>
> You should be able to use "myth.find_orphans.pl" which is in my
> contrib folder that came with the ATRpms packages.
> Depending on the version you are running, YMMV
>
> More info:
> http://www.mythtv.org/wiki/Myth.find_orphans.pl

After clicking send, realized I should be more clear... Depending on
if you are using .22 or .21 it may actually work.  It still works for
me on .21.


More information about the mythtv-users mailing list