Results 1 to 7 of 7
Can one server be both the master and the slave?
Can it be for the same directory?
thanks...
- 02-01-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 3
rsync master AND slave both in one box?
Can one server be both the master and the slave?
Can it be for the same directory?
thanks
- 02-01-2010 #2
I understand, you want to have a setup like this?
Server A: /rsyncdata <-> Server B /rsyncdata
And both servers export /rsyncdata to the other one?
Possible, but I wouldnt recommend it. You will run into race conditions, if the same file is modified and then "synchronized".
Basically, the last write will win and this is probably not what you want.
It would be correct to show the user the collision and ask what he wants.
Maybe unison is more appropiate, as it works bi-directional
Unison File SynchronizerLast edited by Irithori; 02-01-2010 at 10:15 PM.
You must always face the curtain with a bow.
- 02-01-2010 #3Just Joined!
- Join Date
- Feb 2010
- Posts
- 3
thanks for the response
i mean like this:
Server A: /rsyncdata > Server B /rsyncdata > Server C /rsyncdata
i'll check out unison, thanks
- 02-01-2010 #4
your setup is well possible with rsync.
Two scenarios:
a) the chain you described
Server A: /rsyncdata > Server B /rsyncdata > Server C /rsyncdata
If you somehow ensure, that the rsync from A to B has terminated succesfull before B to C is started, then all is well.
The simplest (but somewhat unreliable) way is to plan a long enough wait.
b) do the rsyncs from one source.
aka: A -> B
and A -> CYou must always face the curtain with a bow.
- 02-01-2010 #5
Another way of dealing with scenario a)
Server B *pulls* from Server A
but *pushes* to Server C
on Server B:
if this was succesfull, then the return value $? is 0.Code:rsync -av --delete -e ssh user@ServerA:/rsyndata /rsyncdata
test for it, then run
Code:rsync -av --delete -e ssh /rsyncdata user@ServerC:/rsyndata
You must always face the curtain with a bow.
- 02-01-2010 #6Just Joined!
- Join Date
- Feb 2010
- Posts
- 3
thanks i will try that
cheers
- 02-01-2010 #7
Disclaimer:
Be sure, that you have read in the manpage of rsync what the parameter --delete does
You must always face the curtain with a bow.


Reply With Quote