<br><br><div class="gmail_quote">On Sun, Jan 22, 2012 at 5:59 PM, Michael Watson <span dir="ltr">&lt;<a href="mailto:michael@thewatsonfamily.id.au">michael@thewatsonfamily.id.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 23/01/2012 8:11 AM, Tom Hayward wrote:<br>
&gt; On Sun, Jan 22, 2012 at 09:54, Matt Emmott&lt;<a href="mailto:memmott@gmail.com">memmott@gmail.com</a>&gt;  wrote:<br>
&gt;&gt; One of the disks in my storage group went bye-bye, and now there are hundreds of orphaned listings in my slave BE. I&#39;ve tried removing the files using MythWeb, but Mythweb for me has always been historically slow, and attempting to select and delete more than one showing at a time results in a timeout. I was wondering if there&#39;s a SQL query I could run to delete all shows whose file size is less than 1 byte or something. I&#39;ve already run a backup of the database.<br>

&gt; Try this script:<br>
&gt; <a href="http://www.mythtv.org/wiki/Find_orphans.py" target="_blank">http://www.mythtv.org/wiki/Find_orphans.py</a><br>
&gt;<br>
&gt; I&#39;ve only used it to remove orphaned files, but it also supports<br>
&gt; finding and removing orphaned db entries.<br>
&gt;<br>
&gt;<br>
&gt; Tom<br>
&gt; _______________________________________________<br>
&gt; mythtv-users mailing list<br>
&gt; <a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
&gt; <a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
&gt;<br>
<br>
</div></div>Yes, the find_orphans.py script works really well, can also removes<br>
thumbnail images, orphaned DB entries, orphaned files, and unknown files<br>
located in your storage folders.<br>
<span class="HOEnZb"></span></blockquote><div><br>Thanks, I had forgotten about this script. I&#39;m having a problem though - I pasted the contents of that script into find_orphans.py and chmod +x&#39;ed it, but when I run it I get the following:<br>
<br>matt@magicbe:/usr/share/doc/mythtv-backend/contrib/maintenance$ ./find_orphans.py <br>Traceback (most recent call last):<br>  File &quot;./find_orphans.py&quot;, line 3, in &lt;module&gt;<br>    from MythTV import MythDB, MythBE, Recorded, MythError<br>
  File &quot;/usr/lib/pymodules/python2.6/MythTV/__init__.py&quot;, line 55, in &lt;module&gt;<br>    exec(import26)<br>  File &quot;&lt;string&gt;&quot;, line 5, in &lt;module&gt;<br>  File &quot;&lt;string&gt;&quot;, line 7, in &lt;module&gt;<br>
  File &quot;/usr/lib/pymodules/python2.6/MythTV/connections.py&quot;, line 18, in &lt;module&gt;<br>    import lxml.etree as etree<br>ImportError: No module named lxml.etree<br><br>I tried running it with sudo but received the same result. Do I need to pass any type of connection parameters?  <br>
</div></div>