[mythtv-users] Sync 2 remote backends over VPN
Craig G.
craig at goranson.org
Sun Sep 14 00:01:51 UTC 2008
robbinsck1 at gmail.com wrote:
>
> 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.)
More information about the mythtv-users
mailing list