How about something simple like:<br><br><br>#!/usr/bin/perl<br><br> use strict;<br> use DBI();<br> my $path = "/var/lib/mythtv/recordings/";<br> my $username = "mythtv";<br> my $password = "";<br>
my @files;<br> my @recorded;<br> my $line;<br> # Connect to the database.<br> my $dbh = DBI->connect("DBI:mysql:database=mythconverg;host=localhost",<br> $username, $password,<br>
{'RaiseError' => 1});<br><br><br> # Now retrieve data from the table.<br> my $sth = $dbh->prepare("SELECT basename FROM recorded");<br> $sth->execute();<br><br> while (my $ref = $sth->fetchrow_hashref()) {<br>
push (@recorded, $ref->{'basename'});<br> }<br> $sth->finish();<br><br> # Disconnect from the database.<br><br># Get listings from $path<br>@files = `ls $path | grep -v .png | grep -v .lock`;<br>foreach $line (@files) {<br>
chomp $line;<br> print "$line\n" unless (grep (/$line/, @recorded));<br>}<br><br><br><div class="gmail_quote">On Feb 9, 2008 1:11 AM, Michael T. Dean <<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On 02/08/2008 07:15 PM, Mike Smith wrote:<br>>> You could use <a href="http://myth.rebuilddatabase.pl" target="_blank">myth.rebuilddatabase.pl</a> to identify files that aren't in<br>
>> the DB. Whether it will still work to put them there is another<br>>> question, though. I'd copy the filename it mentions, then tell it to<br>>> ignore the files.<br>> find_orphans is apparently what I used last time, but the only version I can<br>
> find now is updated to work with storage groups and doesn't work on 0.20.<br>> Anyone out there have an older version?<br><br></div></div>Did you try running <a href="http://myth.rebuilddatabase.pl" target="_blank">myth.rebuilddatabase.pl</a>?<br>
<div><div></div><div class="Wj3C7c"><br>Mike<br>_______________________________________________<br>mythtv-users mailing list<br><a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br><a href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users" target="_blank">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a><br>
</div></div></blockquote></div><br>