0

Does Rsync after copy only send the differences between the folders, or does it copy the entire folder again since Rsync has never been implemented before on that folder?

2

Usually yes; rsync works by checking if a file exists, then if its checksum is not the same, then if parts of the file have the same checksum, then transmit the parts which have a different checksum (or, falling back to transmitting the entire file if it's missing or it's impossible to find a part which has a matching checksum on both sides). So if you have a file with the same name but completely different contents, it may be cheaper to transmit the whole file instead of the difference.

No state is kept outside of the file itself, so it does not matter whether you have used rsync before. The contents in the file is the only thing that rsync uses to decide what to transmit.

  • I tested it, I scp'd a 100Mb folder from a remote location to local, and then I rsync'd from that remote to this new local over it, and it took a tiny amount of time at first, and the second time I rsync'ed it was around 0.5 sec, so basically yes, copying before Rsync is ok. – Hermann Ingjaldsson Jun 4 '13 at 8:15
0

rsync can do both. If you do something like

rsync -auvz /some/directory remotehost:/destination

then /some/directory will be copied recursively to remotehost such that /destination/directory will then exist. If you run the command again, only changes will be sent.

If you want files at the destination to be deleted if they no longer exist at the source, add the --delete option.

  • Yes but when running rsync after having run copy, will then only the changes be sent? – Hermann Ingjaldsson Jun 4 '13 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.