View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 12 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Nov 29, 2005 2:14 am 
Offline
Joined: Fri Nov 25, 2005 10:32 pm
Posts: 25
Location: UNC-C
Well after toying around for the past few days I'm quite happy with my KnoppMyth installation. It's fantastic, and I swear once I actually have the money to donate I will! Living the college life gets expensive..

anyways, I've talked with members of my school's LUG (The UNC-C LUG) and a few others are interested in the project. I'm going to be documenting my installation process and doing a presentation at some point, and I wanted to also do something different from the "basic" install. My idea's also really practical for me.

I'd like to have my /myth/music collection be a direct mirror of the music collection I have stored on this PC, so that if/when I take the MythTV box out to other places I have the collection with me, and so there's a large collection of music to show it off.

At first the obvious answer is to simply copy it over the network, but as long as I'm doing that I'd like to keep it up to date with my collection. I'm thinking some scripts using rsync are in order for this, but I was wondering if anyone else has done so. I did a quick search, I admit, but for the most part everything I read talked more about copying things once, never keeping something "constantly updated."

Also, I've never toyed with rsync so I was also wondering if this is a good idea or if there's a better way of doing this?

_________________
www.netsyndrome.net -- designs.netsyndrome.net -- www.mobileasses.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 2:51 am 
Offline
Joined: Sun Jun 12, 2005 2:39 pm
Posts: 464
Location: UK
rsync is pretty easy to use, are both machines running linux?

you could also just script cp with the switch to only copy files that have a newer date stamp.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 3:01 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
It's been a while since I did this, but rsync was the best solution I could find to sync two boxes.

You will have to go through the man pages to figure out the options, but a couple of things to watch out for or you will get extremely long syncs, even when there are no changes.

    If you are going UNIX<->WIN, you need to widen the acceptable timestamp difference window. Windows apparently isn't very accurate with timestamps and you can end up having checksums exchanged for every file.
    I can't remember the default, but you want rsync to only exchange the checksums on a file if the timestamps do not match.
Expect an extremely long sync the first time if you have a lot of music. These changes only help subsequent syncs.

You will have to search for a PC version of rsync. I ended up using www.cygwin.com, but that might be overkill if that is the only unix utility you are using on the PC.

Cheers,

Allen

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 3:08 am 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
If you are going Win -> Linux you could possibly use Robocopy and you can set it to only copy newer files. I use it at work for Win backups and it works very well. I suspect that it should work fine over a samba share to your Linux box.

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 4:22 am 
Offline
Joined: Fri Nov 25, 2005 10:32 pm
Posts: 25
Location: UNC-C
both machines are linux. This PC I'm on now is my new AMD64 box with gentoo, the machine that's the PVR now is my old slackware box that i now dedicated to MythTV.

thanks for the helpful responses, I'll keep all this in mind. If I'm happy with the script I'll post it. Ideally I'll have it:
1. check on boot
2. check "periodically" (set in config)
3. use either NFS or SMB

and as I come up with new ideas as I write it I'll add them...

_________________
www.netsyndrome.net -- designs.netsyndrome.net -- www.mobileasses.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 6:02 am 
Offline
Joined: Sun Jun 12, 2005 2:39 pm
Posts: 464
Location: UK
If your going to be using rsync over 100mb/s network make sure you don't use compression!

I think rsync is going to be a bit overkill for this, rsync is designed to be efficient when the individual file contents are changing. Mp3s are pretty static in this regard.

Say you have your local music collection in /myth/music and your master copy mounted over the network (samba or nfs?) in /mnt/mastermusic

if you run the command:

Code:
cp -au /mnt/mastermusic/ /myth/music/


It will only copy the new files.

You could add this command to cron, or run on startup etc. I think for what you want to do this will be much easier to setup.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 5:28 pm 
Offline
Joined: Fri Nov 25, 2005 10:32 pm
Posts: 25
Location: UNC-C
I think you're right. I started toying with the rsync stuff last night, and it's much to advanced for such a simple task.

I'm going to just make a cron job and boot mode for it. Thanks for the help!

_________________
www.netsyndrome.net -- designs.netsyndrome.net -- www.mobileasses.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 7:14 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Huhn? The whole point of rsync is to do stuff like this. It's what I use to keep the music on my KnoppMyth box up to date with my main Linux workstation box. The following command (copying from the workstation to knoppmyth) is essentially instantaneous when the files are already in sync:
Code:
rsync -ave /usr/bin/ssh ~/mp3/* mythtv@black2:/myth/music/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 9:27 am 
Offline
Joined: Thu Aug 03, 2006 6:15 am
Posts: 43
Location: College Station, TX
I am using Karens Replicator http://www.karenware.com/powertools/ptreplicator.asp to push from my windows box to mythtv. I created a shortcut from within Karen's Replicator and am calling that shortcut nightly through windows scheduled tasks.

Takes a while the first time, but it is very quick after that.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 11:08 am 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Quote:
rsync -ave /usr/bin/ssh ~/mp3/* mythtv@black2:/myth/music/

tjc, in order for the rsync to function as in a cron task, do you not have to build a key set? Otherwise it will be looking for a passwd? I use it all the time to shuffle stuff manually and it always asks for the passwd.

Thanks
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 5:47 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Yes. Although I think there's also another way to do it if you check the rsync man page.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 11:17 am 
Offline
Joined: Fri Feb 03, 2006 1:26 pm
Posts: 2
Location: Boulder, CO
If you create an SSH key pair on the source host with a null passphrase then you'll be able to do the rsync without a password prompt.

1. On the source computer do an ssh-keygen command and just hit return when prompted for a password.

2. Copy the ~/.ssh/id_rsa.pub file to ~/.ssh/authorized_keys on the destination host. The file may be ~/.ssh/id_dsa.pub if you created a DSA key pair instead of an RSA key pair.

3. You can check by attempting an SSH connection from the source host to the destination and you should get connected automatically without being prompted for a password.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu