LinHES Forums
http://forum.linhes.org/

Script to verify DB vs tv mpg files
http://forum.linhes.org/viewtopic.php?f=11&t=14287
Page 1 of 1

Author:  tuatara [ Tue Feb 20, 2007 2:23 am ]
Post subject:  Script to verify DB vs tv mpg files

[Boring background: weird crash. Myth was running slow so I ssh'd in found mythtv restoring from last backup and reapplying DB upgrades... Last backup was from Aug last year. So now I have a DB from Aug and mpg files from now:
a) most tv files older than Aug are ok - they were in the backup and I still have the video file.
b) some tv files older than Aug are missing the video file (because we watched and deleted them) but have their DB entry brought back from backup.
c) tv files newer than Aug are all screwed - they are not in the DB]

Question:
Is there a script that will sanity check the DB vs TV video files removing any inconsistencies?


So it will check the 'recording' table and delete any recorded programs for which the video file is missing, and delete any tv mpg file for which the DB entry is missing. Also, I've noticed that not all tv jpg files get deleted so I have a few of those hanging around. Be nice if it removed them too.

Does this exist??

Thanks
Paul.

p.s. Sneaky trick for people who have had their DB corrupted and have reinstalled. As you know, there is no way to get the TV database entries back. But look at the tv file - you can tell what the channel, date/time was, and therefore you can find out what the TV program was. Move it to /myth/video and give it a decent name (like "Star Trek.mpg"). Then Setup/Video/Rescan and you can watch them again.

Author:  tjc [ Tue Feb 20, 2007 7:55 pm ]
Post subject: 

Try the /usr/local/bin/myth.rebuilddatabase.pl script. It won't help with deleted stuff, but it will definitely help with adding back anything in /myth/tv.

Searching for recent posts by me that mention myth.rebuilddatabase.pl should turn up some notes I posted after an experimental version wiped out my recordings table and forced a restore from a 2-3 week old backup. Aha, here it is: http://mysettopbox.tv/phpBB2/viewtopic.php?t=14002&highlight=myth+rebuilddatabase

Author:  tuatara [ Wed Feb 21, 2007 1:41 pm ]
Post subject:  Fixed!

That did the trick.
Thanks.
Paul.

tjc wrote:
Try the /usr/local/bin/myth.rebuilddatabase.pl script. It won't help with deleted stuff, but it will definitely help with adding back anything in /myth/tv.

Searching for recent posts by me that mention myth.rebuilddatabase.pl should turn up some notes I posted after an experimental version wiped out my recordings table and forced a restore from a 2-3 week old backup. Aha, here it is: http://mysettopbox.tv/phpBB2/viewtopic.php?t=14002&highlight=myth+rebuilddatabase

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/