Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 03-27-2009, 02:24 PM   #1
Don_Ron
Prospect
 
Join Date: Mar 2009
Posts: 1
Question Copy only newer files with rsync

Hello:

I have a big iTunes music library on my office mac ("A"). I also have a big, but slighty different iTunes library on my home mac ("B"). They both have grown with different songs and videos lately.

Now I want to sync/merge them. I just copied the complete A library to an external HD and want to merge the media on it with that on the B machine. So the result (on B) should have all files from both A and B. Files on A that are already present on B do not need to be overwritten.

(How) can I use the rsync command correctly to do so?

Thanks for your help.

Ron
Don_Ron is offline   Reply With Quote
Old 03-29-2009, 06:46 PM   #2
cloudsy
Registered User
 
Join Date: Mar 2009
Posts: 1
Hi,

If rsync'ing between two different machines that run ssh, you could do something like this:

Code:
rsync -e 'ssh' -auv /directory_with_files/ username@ip:/target_directory/
Since you mentioned you had an external disk, I assume you'll probably be doing it on the local machine, so this is more likely to apply:

Code:
rsync -auv /external_disk_dir/ /Users/username/target_dir/
The '-a' is for performing an 'archive' which consists of multiple helpful options (recursion, saving of permissions, links, etc.). The '-u' option will update files only when the source is newer than the destination.

Hope that helps
cloudsy is offline   Reply With Quote
Old 04-06-2009, 07:10 PM   #3
kiss-o-matic
Prospect
 
Join Date: Dec 2008
Posts: 12
The -delete option comes in handy if the library gets too big (the destination won't delete files deleted at the source w/o it). But worth noting, from what I know of rsync, it makes sure the destination has what the source has. It's not bidirectional. You'd need to run two instances of it (w/o the -delete option) but note that you can overwrite something assuming files have the same name but are actually different. Shouldn't be an issue w/ mp3s. I wouldn't suggest it for something like source code though.
kiss-o-matic is offline   Reply With Quote
Reply

Tags
rsync

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:18 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.