[mythtv-users] lost recordings and database orphans

Michael T. Dean mtdean at thirdcontact.com
Wed Mar 24 18:00:22 UTC 2010


On 03/24/2010 09:13 AM, Greg Woods wrote:
> Yeah, I was afraid it would be something like this, but thank you very
> much for all the detail. I'm certain I could never have figured that out
> for myself. I'll probably give it a shot when I can set aside a block of
> time (maybe after work today).
>
> One more question: is there a more brute force and easier way? Is there
> a way I could clean things out completely by removing the remaining
> recording files and then emptying a few tables? I realize I would lose
> what recordings I still have, but it might be a lot easier and more
> reliable to use this approach. At least I would then have a database
> that was consistent with reality.
>
> I suppose I could accomplish that by just wiping the entire database,
> but then I would have to recreate all my settings as well and I'd prefer
> to avoid that, especially since I just spent a few hours dealing with
> the Comcast analog-to-digital conversion and redoing all my channels. I
> don't want to have to do THAT again.
>    

1. Move any recordings out of your recordings directories and into, for 
example, MythVideo directories, and verify that all your recordings 
directories are completely empty.
2. Execute the command:

mysql -umythtv -p mythconverg \
       -e "SELECT CONCAT('touch ', basename) FROM recorded;" |
   tail -n+2 >  $HOME/touch_files

3. Change (cd) into any directory in the master backend's Default 
storage group.
4. Execute the command:

sh $HOME/touch_files
5. Go to Watch Recordings
6. Find the Deleted recording group in the left column (you may have to 
change Group View andor Group Filter to see it)
7. Then select MENU|Add this Group to Playlist
8. Then MENU|Playlist options|Delete, and allow re-record

If you have multiple hosts with disconnected storage, this won't 
necessarily work.  The easiest fix is to just share the directory (from 
the master backend's Default storage group) in which you created the 
empty files to all your backends and mount it in the exact same location 
it's mounted on the master backend.

Mike


More information about the mythtv-users mailing list