LinHES Forums
http://forum.linhes.org/

Setting up /myth/music to be a mirror of another collection?
http://forum.linhes.org/viewtopic.php?f=6&t=7124
Page 1 of 1

Author:  spydirweb [ Tue Nov 29, 2005 2:14 am ]
Post subject:  Setting up /myth/music to be a mirror of another collection?

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?

Author:  mad_paddler [ Tue Nov 29, 2005 2:51 am ]
Post subject: 

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.

Author:  alien [ Tue Nov 29, 2005 3:01 am ]
Post subject: 

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

Author:  Girkers [ Tue Nov 29, 2005 3:08 am ]
Post subject: 

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.

Author:  spydirweb [ Tue Nov 29, 2005 4:22 am ]
Post subject: 

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...

Author:  mad_paddler [ Tue Nov 29, 2005 6:02 am ]
Post subject: 

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.

Author:  spydirweb [ Tue Nov 29, 2005 5:28 pm ]
Post subject: 

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!

Author:  tjc [ Tue Nov 29, 2005 7:14 pm ]
Post subject: 

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/

Author:  jessebs [ Thu Oct 19, 2006 9:27 am ]
Post subject: 

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.

Author:  mjl [ Thu Oct 19, 2006 11:08 am ]
Post subject: 

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

Author:  tjc [ Thu Oct 19, 2006 5:47 pm ]
Post subject: 

Yes. Although I think there's also another way to do it if you check the rsync man page.

Author:  ahsia [ Fri Oct 20, 2006 11:17 am ]
Post subject: 

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/