Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-31-2006, 10:15 AM
|
#1
|
|
Member
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69
Rep:
|
Rsync between multiple machines
Hi everyone!
I have a design question related to rsync.
My friends and I each have our own local linux servers at our respective homes, and we'd like to set up a directory in each that rysncs to the other two servers. Is this possible?
Example:
I upload a patch to a game on the directory on my local server. At midnight, I want that file to rsync over to my two friends' servers. I want it to work in reverse too, so if they upload I want it to drop to my server as well.
The only major issue I can see with this is, what happens if I upload something and my friend uploads something on the same day. RSYNC will run at night, but both folders will have differences.
Will one server completely overrite the other, thus causing the changes written by one person to be lost?
Is there a better way to accomplish this?
Thanks!
|
|
|
|
07-31-2006, 10:55 AM
|
#2
|
|
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,392
Rep:
|
Yes it is possible and I use very similar setup here.
Just setup one rsync server and let it to copy to or copy from as needed to keep both dirs in sync.
Use compress (-z) to save bandwidth and make the server accept connections only from the other machine. Do not use the --delete option. It is good only for a one-way setup.
If any connection is assymetric (upload is smaller than download) like in ADSL lines, just remember that. It will take a bit longer to transfer files in that direction.
Leave the ports open in your firewall or router and you be fine.
|
|
|
|
07-31-2006, 11:00 AM
|
#3
|
|
Member
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69
Original Poster
Rep:
|
So i'll have RSYNC running on only one machine and it will do the pulling and pushing to keep everything in sync.
Sounds good, that should be a fairly easy setup. Thanks!!
|
|
|
|
07-31-2006, 11:08 AM
|
#4
|
|
Moderator
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,505
Rep: 
|
I would strongly encourage the use of CVS or Subversion for something like this. If you're both going to be making changes, this will help keep you from blowing away the others changes and help to maintain a central 'repository' for it.
|
|
|
|
07-31-2006, 11:12 AM
|
#5
|
|
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,392
Rep:
|
rsync will run in both machines. In the server, it will accept connection from the client machine. In the server this is done enabling rsync in xinetd and creating a /etc/rsync.conf which defines your sync. Something like this:
Code:
[test]
comment = test
path = /export/test
read only = false
list = true
hosts allow = 192.168.155.202
On the client, is where the connection starts. The cmd line for a client may be something like this: "rsync -azrR source_dir rsync://remoteserver/test"
That name "test" identify on the server the sync dir. You can have several sets of sync dirs and they can be syncronized at different times.
good luck !
|
|
|
|
07-31-2006, 11:18 AM
|
#6
|
|
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,392
Rep:
|
Matir brings up a important think here. If you both make changes in the SAME file, CVS or subversion is more appropriated than rsync. In the other hand, if the changes are not in the same file, and you want just to keep a common repository, than rsync could be used, because it has a simpler setup than cvs or subversion.
Last edited by marozsas; 07-31-2006 at 11:20 AM.
|
|
|
|
07-31-2006, 11:51 AM
|
#7
|
|
Moderator
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,505
Rep: 
|
Quote:
|
Originally Posted by marozsas
Matir brings up a important think here. If you both make changes in the SAME file, CVS or subversion is more appropriated than rsync. In the other hand, if the changes are not in the same file, and you want just to keep a common repository, than rsync could be used, because it has a simpler setup than cvs or subversion.
|
Even so, if both people want the same data, you'd need to rsync twice, so changes from A get propagated to B and from B to A.
|
|
|
|
07-31-2006, 11:22 PM
|
#8
|
|
Member
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69
Original Poster
Rep:
|
Thanks for all the replies. For now i'm just going to keep a common repository and sync machines from a master RSYNC server.
IE:
Master gets new file uploaded locally, pushes file to Sync machine A, pulls new files from sync machine A that were uploaded that night as well. On the next night it will do the same to B, then the following night to A again and so on.
Does that seem plausible? I'm looking for something just easy to setup right now, i'll get more complicated when i have more time to play around. This isn't critical financial data or anything, just basic documents, some music files, game files, etc.
|
|
|
|
| Thread Tools |
Search 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
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:53 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|