A handy mythtv recording importer
I wanted to export all my saved recordings from my old mythbox, and import them into my new mythbox. Now, with mytharchive, exporting (to a native archive) is easy, just select all the recordings you want to export, then set it going and it exports them all.
Problem is, to import to the new machine, if you use the menu interface you can only import one file at a time, which is a bit of a PITA. So I knocked up the following script, which imports all the programs saved in the current directory. How it works should be pretty obvious, the only slightly clever bit is that it extracts and uses the same channel ID as in the original recording.
# Get all files in current directory myXMLFiles=$(ls *.xml) # Loop through all files for loopFile in $myXMLFiles do channel=$(cat $loopFile | grep "<chanid>" | sed 's:<chanid>::;s:</chanid>::') mytharchivehelper -f $loopFile $channel; done