[mythtv-users] Verify files in recordings? Old data

Yeechang Lee ylee at pobox.com
Thu Dec 14 19:00:20 UTC 2006

Mark Hutchinson <mark at onnow.net> says:
> I think I may have some files in my recordings directory that may
> not be referenced in my database ( and therefore not visable in
> MythTV ) and would like to verify and clean them out.
> Is there a way to do this?  Anyone come up with a script or anything
> for this?

As usual, the archives answer all:


The following is a shell script I wrote that uses what's contained in
the above message:


# mythorphaned - 

mysql -umythtv -pmythtv mythconverg -B \
-e 'SELECT basename FROM recorded;' > /tmp/mythfiles

# Specify the directory MythTV records to (I have multiple entries
# here since I use Lincoln Dale's multiple-directories patch
# (<URL:http://svn.mythtv.org/trac/ticket/1744>)
ls /mythtv/video /mythtv/video2 /misc/cube/mythtv/store | \
grep -vf /tmp/mythfiles | \
grep -v 'nfslockfile.lock'

rm -rf /tmp/mythfiles


As I am utterly ignorant of SQL, I'd appreciate suggestions on how to
automatically extract the recording directories from the database.

Yeechang Lee <ylee at pobox.com> | +1 650 776 7763 | San Francisco CA US

More information about the mythtv-users mailing list