Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 1st, 2006, 06:30 PM
sstringer's Avatar
sstringer sstringer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Dallas, TX
Posts: 135 sstringer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 27 m 28 sec
Reputation Power: 11
Send a message via Yahoo to sstringer
Question Rsync / sync two folders? How do I do this 2-way?

I'm trying to sync two folders on my system. I know I can use rsync to mirror two folders, but this appears to be only a one-way deal where dir1 is mirrored over dir2. What I need is to sync both dir1 and dir2 so that the latest copies of varies files (along with deletes) will be updated in whichever folder.

Is there a way to do this with rsync or with some other command?

Many thanks,
Steve
__________________
Steve Stringer
MapTechnica.com - Free mapping tools, zip code finder, and data for your custom mapping application.
StringerSites.com - Custom website development for small businesses

Reply With Quote
  #2  
Old December 7th, 2006, 01:28 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,345 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 39 m 18 sec
Reputation Power: 55
Suppose your sync dirA with dirB. Then everything in dirB that is NOT also in dirA will be deleted if you start to sync dirA->dirB. The reverse is true, if you start the sync going dirB->dirA.

You have to have a "master" for a scheme like the one you want to work. You will have to set up a list of files for which dirA always will have the correct version, and another list for dirB. You can create two exclude files - one to prevent dirA->dirB from updating the files in dirB for which it is the master, and another list for
preventing the update of file that live in dirA for which those files are the master copy.

I don't know how you handle the problem of files with new names, say a new file pops up in dirB....

Basically the whole concept as presented has problems. What exactly are you trying to do? Not how you want to do it.

Last edited by jim mcnamara : December 7th, 2006 at 01:31 PM.

Reply With Quote
  #3  
Old December 7th, 2006, 03:12 PM
sstringer's Avatar
sstringer sstringer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Dallas, TX
Posts: 135 sstringer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 27 m 28 sec
Reputation Power: 11
Send a message via Yahoo to sstringer
Quote:
Originally Posted by jim mcnamara
What exactly are you trying to do?


In a word, sync. I have files on a desktop and a laptop (both Macs) that I need to keep synchronized. Sometimes I work on one set, other times I work on the other. Seems like this is a solved problem with countless utilities out there. However, rsync is built in and it seems odd that rsync doesn't handle this most basic of synchronization tasks.

In the end, I have done two things:

1) I've put both sets of source files under version control with SVN.

2) For less important things, I plunked down $$$ for a utility called ChronoSync.

So problem solved, though not in the way I had hoped, nor in a free manner. Seems only logical that rsync should handle this with ease. Guess not.

Reply With Quote
  #4  
Old December 8th, 2006, 05:26 AM
ishnid's Avatar
ishnid ishnid is offline
kill 9, $$;
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Sep 2001
Location: Shanghai, An tSín
Posts: 6,894 ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Months 2 Weeks 1 Day 22 h 49 m 47 sec
Reputation Power: 3885
Man, how did I miss this thread before?

Unison is a free tool I use for this (on Linux, but it works on Macs too). I guess it's not much use to tell you that *now* - sorry about that.

Reply With Quote
  #5  
Old November 11th, 2012, 06:51 PM
ludjo011 ludjo011 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: Belgrade, Serbia
Posts: 1 ludjo011 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 46 sec
Reputation Power: 0
Hey,

I've stumbled upon your post today (I see it dates some 6 years ago ) since I've faced the same problem I figured out how to do the thing you wanted with rsync. You just pass the "-u" option (without quotes) to your parameter list when you execute the command.

I hope you found the answer already but others like me will surely find this reply useful.

Best regards.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Rsync / sync two folders? How do I do this 2-way?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap