You are not logged in.

#1 2009-11-24 00:26:57

carzzz215
Member
Registered: 2007-10-14
Posts: 24

An rsync question

Lets say I have machine 1. On machine 1 I have a parent folder, and in that parent folder I have Folder A and Folder B.  In Folder A I have a 500 megabyte file, and there is nothing in Folder B.

Now I rsync to this parent folder to machine 2.  So on machine 2, I have the same thing.  There is a parent folder. Inside the parent is Folders A and B.  In folder A there is my 500 megabyte file and there is nothing in Folder B.

Now on machine 1, lets say I move (mv) the 500 megabyte from Folder A to Folder B.  So now there is nothing in Folder A and the 500 megabyte file in Folder B on machine 1.

When rsync is run again, will it tranfer the whole 500 megabyte file again, or is rsync smart enough to know that it can just move (mv) the 500 megabyte file from Folder A to Folder B one machine 2?

Offline

#2 2009-11-24 00:57:28

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: An rsync question

It will transfer again I believe... If you want "intelligence" like that, I'd suggest unison.

Unison is smart enough to locate an identical file on the destination and just mv and/or copy it locally rather than transfer it again. Doesn't even have to have the same name smile

Last edited by fukawi2 (2009-11-24 00:58:15)

Offline

#3 2009-11-24 00:58:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: An rsync question

"What is the airspeed velocity of an unladen swallow?"
I'd say rsync isn't that smart, but I'm going to check it right now.

Edit: Now we know for sure, it *will* copy the file again: 'rsync -avz 1 2'.
You can always manually move the file on the other machine from A to B before running rsync :-)

Last edited by karol (2009-11-24 01:07:35)

Offline

#4 2009-11-24 01:11:31

carzzz215
Member
Registered: 2007-10-14
Posts: 24

Re: An rsync question

@fukawi2 - Thanks for the unison suggestion.  I'll look into that.

@karol - wow, thanks for actually testing that for me.  And yes, now we know. smile

Offline

#5 2009-11-24 14:36:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: An rsync question

Yeah, we know the limitations of rsync, but what about the European / African swallow?

Can you mark the topic as solved?

Offline

Board footer

Powered by FluxBB