synchronizing laptop's and desktop's home directories (was laptop sharing home directory with desktop)

synchronizing laptop's and desktop's home directories (was laptop sharing home directory with desktop)

Post by Luca Pired » Sat, 06 Aug 2005 14:14:57



Indeed. Thanks for pointing that out.


The problem with rsync is that it only copies changes one way (would be from A
to B, but not from B to A in your example). If I made changes in both
computers' home directories I would have a problem.

Luca
 
 
 

synchronizing laptop's and desktop's home directories (was laptop sharing home directory with desktop)

Post by Unru » Sat, 06 Aug 2005 16:37:57

Luca Pireddu < XXXX@XXXXX.COM > writes:







This is an unsolvable problem IF you changed the same files on both
machines. On the other hand if you change file a on A and b on B then doing
rsync both ways works.
Ie, use the newer conditional and transfer files from A to B and then from
B to A.

man rsync
-u, --update update only (don't overwrite newer files)
-u, --update
This forces rsync to skip any files for which the destination
file already exists and has a date later than the source file.

In the currently implementation, a difference of file format is
always considered to be important enough for an update, no mat-
ter what date is on the objects. In other words, if the source
has a directory or a symlink where the destination has a file,
the transfer would occur regardless of the timestamps. This
might change in the future (feel free to comment on this on the
mailing list if you have an opinion).

 
 
 

synchronizing laptop's and desktop's home directories (was laptop sharing home directory with desktop)

Post by reply_add » Sat, 06 Aug 2005 18:29:09


No, taint :o)
man rsync:
To synchronize my samba source trees I use the following Makefile targets:

get:
rsync -avuzb --exclude '*~' samba:samba/ .

put:
rsync -Cavuzb . samba:samba/

sync: get put

this allows me to sync with a CVS directory at the other end of the connection.

Cheers
 
 
 

synchronizing laptop's and desktop's home directories (was laptop sharing home directory with desktop)

Post by Unru » Sat, 06 Aug 2005 18:44:57


XXXX@XXXXX.COM writes:






Yes, it is. If you have a file called dummy on A and a file called dummy on
B AND you have changed the file dummy on both A and B in incompatible ways,
there is NO WAY with rsync to incorporate the two sets of changes on both A
and B. YOu have to do that by hand. With your ( and my) solution, the newer
of the changes (ie you just happened to change dummy on A later than on B,
then dummy on A would replace dummy on B on both which you probably do not
want.)