[mythtv-users] Need some help recovering from a filesystem crash

nowhere nowhere at cox.net
Tue Oct 12 03:34:45 UTC 2004


Thanks for the tip William. I was under some EXTREME pressure to get the
system back up and running ASAP so I wrote a quick (VERY quick!) perl
script to mplay each video and route it to myth (including the db) or to
the crap folder (heh!).

It's extremely ugly but I'll post it for all you experienced users to
laugh at...

Let me know if you want to add it to the contrib LoL!

Thanks!
Eric

#!/usr/bin/perl
@filelist = `ls .`;
foreach $item (sort @filelist) {
        `mplayer -fs -zoom -quiet -vo xv -ao alsa $item`;
        ($filename,$extension) = split ('\.', $item);
        chomp $extention;
        ($chanid,$starttime,$endtime) = split ('_', $filename);
        print "$item  Do you want to keep this file? ";
        $i=$item;
        chomp($i);
        chomp($answer = <STDIN>);
        if ($answer eq 'y' || $answer eq 'Y') {
                print 'Title: '; chomp($title = <STDIN>);
                open(FILE, '>/home/mythtv/addvideo.sql') or die "Cannot
open file\n";
                print FILE "connect mythconverg;\n";
                print FILE "insert into recorded VALUES
($chanid,$starttime,$endtime,\n";
                print FILE "\'$title\',\' \',\' \',\'
\',\'localhost.localdomain\',NULL,0,NULL,0,0,\'Default\',0,0,0,$
endtime,0,0,0,0);";
                close FILE;
                `mv $i /video/recording/`;
                `mysql -u root -pxxxxxxxxx < /home/mythtv/addvideo.sql`;
        }
        else {
                `mv $i /video/crap`;
        }
}
exit (0);


> -----Original Message-----
> From: mythtv-users-bounces at mythtv.org 
> [mailto:mythtv-users-bounces at mythtv.org] On Behalf Of William
> Sent: Sunday, October 10, 2004 5:35 AM
> To: 'Discussion about mythtv'
> Subject: RE: [mythtv-users] Need some help recovering from a 
> filesystem crash
> 
> 
> In .16 there is a util in the contrib folder called (i think) 
> mythrebuilddatabase which should do exactly what you want.
> 
> > -----Original Message-----
> > From: mythtv-users-bounces at mythtv.org
> > [mailto:mythtv-users-bounces at mythtv.org] On Behalf Of nowhere
> > Sent: Friday, October 08, 2004 12:21 AM
> > To: MythTV Users
> > Subject: [mythtv-users] Need some help recovering from a 
> > filesystem crash
> > 
> > 
> > Hey everyone,
> > 
> > Unfortunately I was unable to recover my root partition from
> > a crash I had. Luckily tho, all the hardware seems to be ok 
> > at the moment.
> > 
> > So, I have reinstalled with FC2 (needed to do this anyway)
> > and I was able to recover my /video partition so I have all 
> > the recordings. I am hoping the following exists: 1. A source 
> > I can reverse lookup the chanid,starttime to get the show 
> > title and subtitle 2. A script already written to ls, lookup, 
> > and insert back into the db.
> > 
> > I'm quite sure I am nuts to think that this exists but worth
> > a try anyway.
> > 
> > In the likely case there is no script does anyone know
> > how/where I can do the reverse lookup?  If I can get this 
> > info the script I can write...
> > 
> > Thanks!
> > Eric
> > 
> > 
> 
> 
> 



More information about the mythtv-users mailing list