[mythtv-users] Database / storage housekeeping

Michael T. Dean mtdean at thirdcontact.com
Fri Mar 31 05:17:20 UTC 2006

On 03/30/2006 02:09 PM, Jeff Simpson wrote:

> I recently happened to come across this error in my database logs:
> ERROR when trying to autoexpire file: 
> /mnt/store//1311_20060213220000_20060213220000.nuv. File doesn't 
> exist. Database metadata will not be removed.
> Turns out that file didn't exist, but the entry was still in the logs. 
> Does this housekeeping task run all the time,

All the time mythbackend runs.

> and does it list ALL the errors it finds,


> or just the first one? Reason I ask is because I found a similar error 
> yesterday (different file). I wonder if I have a whole slew of missing 
> files that I will find out about 1 day at a time.
> Is there a utility for checking the sanity of the database? Something 
> that compares the file list to the database and vice versa, tells you 
> about files that aren't in the database and database entries with no 
> files attached. I'm especially interested to see if there are any 
> unattached files, as they are effectively wasting space on the mythbox.

To find files without database entries, use myth.rebuilddatabase.pl.  To 
find entries without files, do a "SELECT COUNT(*) FROM oldrecorded;" and 
compare it with "ls /path/to/recordings | wc -l".

> (yes, I know I can go through them one at a time or write a script to 
> do it, I'm just wondering if one already exists before I spend time on it)

Or, do a "rm /path/to/recordings/*.png" and use MythWeb's "Recorded 
Programs" page and look for black preview images (which typically 
indicate non-existent files) and verify with the backend logs (which 
will report preview image generation errors).


More information about the mythtv-users mailing list