[mythtv-users] Cleanup script

George Nassas gnassas at mac.com
Tue Oct 10 18:15:40 UTC 2006


On 9-Oct-06, at 9:23 PM, Monkey Pet wrote:

> Hi, my mythbox has been running for the last 4 years and gone  
> though many things.  I was wondering if their is a script to do the  
> following: compare NUV files with entries in the db and make sure  
> it exists on both ends (files and db).  If they don't, take the  
> proper action.  I want to accomplish two things.  Free up space by  
> getting rid of rouge files.  Also cleanup the db, so I don't have  
> to manually delete a bunch of entries using the frontend.  Anyways  
> if this doesn't exist, I will just write it myself.

The contrib script myth.rebuilddatabase.pl will help you with the  
first bit - scanning for rouge files and making sure they're in the  
database. It might even locate a few rogue files as well ;)

The other half - removing db rows for entries that have no matching  
files is trickier. You can't know if a file is truly missing or if  
it's on remote storage and temporarily unavailable. On the other  
hand, it'd be nice to have a script that did consistency things like  
verifying that everything in the recordedmarkup table actually has a  
matching row in the recorded table and cleaning out the orphans. That  
would be a good addition to optimize_mythdb.pl which is looking  
pretty skimpy at the moment.

- George



More information about the mythtv-users mailing list