[mythtv-users] Cleanup recordings not in database

Michael T. Dean mtdean at thirdcontact.com
Sat Jun 25 17:23:37 UTC 2011

On 06/25/2011 08:03 AM, Ramon Hofer wrote:
> On 06/25/2011 01:37 PM, Ramon Hofer wrote:
>> On 06/24/2011 06:40 PM, Raymond Wagner wrote:
>>> On 6/24/2011 08:29, Ramon Hofer wrote:
>>>>>>>> On 06/14/2011 06:57 PM, Chris Kapp wrote:
>>>>>>>>> I found this script worked well:
>>>>>>>>> http://www.mythtv.org/wiki/Find_orphans.p
>>>> Hm, it lists the orphaned recordings but it can't delete them:
>>>> The following recordings will be deleted
>>>> ...
>>>>                                                                           Count:          15
>>>> Are you sure you want to continue?
>>>>      >     yes
>>>> Traceback (most recent call last):
>>>>        File "/home/hoferr/bin/find_orphans.py", line 230, in<module>
>>>>          main()
>>>>        File "/home/hoferr/bin/find_orphans.py", line 214, in main
>>>>          opt[1](opt[2])
>>>>        File "/home/hoferr/bin/find_orphans.py", line 135, in delete_recs
>>>>          except MythError:
>>>> NameError: global name 'MythError' is not defined
>>> That specific error was because of a missed include, that resulted in
>>> the error handling not functioning properly.  The initial error was
>>> caused by the backend reporting a failure to delete.  Did you run the
>>> delete once, get a new list of content, and tell it to delete a second time?
>> Yes, I ran the script and didn't delete anything.
>> Then I ran it again and told it to delete.
>> How can I include that missing include?
> I don't know why but somehow the error has disappeared :-)
> Thanks all for your help!

Raymond's point was that if you run the script and tell it to delete 
files, it deletes those files.  Then, if you run the script 
again--before the file system has actually had time to finish removing 
the files--the script will still see the files on the file system, so it 
lists them as "still" orphaned.  However, by the time you tell it to 
delete the files, again, they're gone, so you get an error.

In other words, the only error was that when you tried to delete the 
files you (had already) deleted, they were gone.  So, everything worked 
properly.  You wouldn't have gotten any error had you waited long enough 
before re-running the script to give the system a chance to catch 
up/finish the deletes (which is why you're not getting errors, now).


More information about the mythtv-users mailing list