[mythtv-users] Sync 2 remote backends over VPN

robbinsck1 at gmail.com robbinsck1 at gmail.com
Mon Sep 15 21:37:03 UTC 2008


> You make it sound so easy, and maybe it is....I have the nuvexport to a local directory down. Next
 > is to get automated rsync working with a cron job and the whole 
trusted certificate thing. Then
 > the tricky part, scan and import....:hmmm. What would be a remote 
backend trigger letting it know,
 > it can scan and import? If it runs mid transfer that would be bad, right?
> 

Don't know the the syntaxes off the top of my head, but could have a 
bash script with the following operations:

(this isn't the right command structure, just trying to illustrate the 
concept.)

#output show and sql to tmp directory
nuvexport SomeTVShow.mpg
#copy the show and sql to destination system
scp /tmp/SomeTVshow* account at 192.168.2.1:/storage
#create a trigger file
touch /tmp/sometvshow.start
scp /tmp/sometvshow.start account at 192.168.2.1:/storage

Then on destination system have a cron job that checks the storage 
directory for files with the extension of ".start" and when it sees a 
file with that name it processes the .mpg and .sql files.

#!/bin/bash
FILES=`ls /storage`
for file in $FILES
do
         if [ ! -e "$file" ]
                 NAME=`echo "$file" | cut -d'.' -f1`
                 nuvexport import "$NAME.SQL" "$NAME.mpg";
                 continue;
         then
                 continue;
         fi
done
exit 0


Something like this will work (not correct nuvexport syntax, you will 
need to look that up.)

Ok, so I got everything set up to export, do the transfer etc. 

Where I'm stuck is I cannot figure out how to import the .mpg and .sql files. It seems google don't help either, I thought for sure it was myth.rebuilddatabase.pl but it seems I'm stuck. 

I need guidance on this it seems. 





More information about the mythtv-users mailing list