Skip to main content
deleted 1 character in body
Source Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

So I understand that rsync works by using a checksum algorithm that updates files according to file size and date. But isn't this synchronization dependent on how source and destination are called? Doesn't the order of source to destination change the behavior of what gets synced?

Let me get to where I am going..

Obviously this input1

rsync -e ssh -varz ~/local/directory/ [email protected]:~/remoteFolder/

rsync -e ssh -varz ~/local/directory/ [email protected]:~/remoteFolder/

is not the same as input2

rsync -e ssh -varz [email protected]:~/remoteFolder/ ~/local/directory/

rsync -e ssh -varz [email protected]:~/remoteFolder/ ~/local/directory/

But I thought that either way you called rsync, the whole point of it was so that any file that is newer is updated between the local and remote destinations.

However, it seems that it's dependent on whether your new file is located under the source rather than the destination location. If I updated file1 on my local machine (same, but older file1 on server), saved it, and then used code2 to sync between locations, I noticed that the new version of file1 on my local machine does not upload to the server. It actually overwrote the updated file with the older version. If I use input2 it does upload modified to server.

Is there a way to run rsync in which it literally synchronizes new and modified files no matter whether source or destination locations are called first according to newer/modified file location?

Thanks.

So I understand that rsync works by using a checksum algorithm that updates files according to file size and date. But isn't this synchronization dependent on how source and destination are called? Doesn't the order of source to destination change the behavior of what gets synced?

Let me get to where I am going..

Obviously this input1

rsync -e ssh -varz ~/local/directory/ [email protected]:~/remoteFolder/

is not the same as input2

rsync -e ssh -varz [email protected]:~/remoteFolder/ ~/local/directory/

But I thought that either way you called rsync, the whole point of it was so that any file that is newer is updated between the local and remote destinations.

However, it seems that it's dependent on whether your new file is located under the source rather than the destination location. If I updated file1 on my local machine (same, but older file1 on server), saved it, and then used code2 to sync between locations, I noticed that the new version of file1 on my local machine does not upload to the server. It actually overwrote the updated file with the older version. If I use input2 it does upload modified to server.

Is there a way to run rsync in which it literally synchronizes new and modified files no matter whether source or destination locations are called first according to newer/modified file location?

Thanks.

So I understand that rsync works by using a checksum algorithm that updates files according to file size and date. But isn't this synchronization dependent on how source and destination are called? Doesn't the order of source to destination change the behavior of what gets synced?

Let me get to where I am going..

Obviously this input1

rsync -e ssh -varz ~/local/directory/ [email protected]:~/remoteFolder/

is not the same as input2

rsync -e ssh -varz [email protected]:~/remoteFolder/ ~/local/directory/

But I thought that either way you called rsync, the whole point of it was so that any file that is newer is updated between the local and remote destinations.

However, it seems that it's dependent on whether your new file is located under the source rather than the destination location. If I updated file1 on my local machine (same, but older file1 on server), saved it, and then used code2 to sync between locations, I noticed that the new version of file1 on my local machine does not upload to the server. It actually overwrote the updated file with the older version. If I use input2 it does upload modified to server.

Is there a way to run rsync in which it literally synchronizes new and modified files no matter whether source or destination locations are called first according to newer/modified file location?

Source Link
bretonics
  • 215
  • 2
  • 6

Is rsync really bidirectional or more unidirectional?

So I understand that rsync works by using a checksum algorithm that updates files according to file size and date. But isn't this synchronization dependent on how source and destination are called? Doesn't the order of source to destination change the behavior of what gets synced?

Let me get to where I am going..

Obviously this input1

rsync -e ssh -varz ~/local/directory/ [email protected]:~/remoteFolder/

is not the same as input2

rsync -e ssh -varz [email protected]:~/remoteFolder/ ~/local/directory/

But I thought that either way you called rsync, the whole point of it was so that any file that is newer is updated between the local and remote destinations.

However, it seems that it's dependent on whether your new file is located under the source rather than the destination location. If I updated file1 on my local machine (same, but older file1 on server), saved it, and then used code2 to sync between locations, I noticed that the new version of file1 on my local machine does not upload to the server. It actually overwrote the updated file with the older version. If I use input2 it does upload modified to server.

Is there a way to run rsync in which it literally synchronizes new and modified files no matter whether source or destination locations are called first according to newer/modified file location?

Thanks.