0

From rsync manpage

SORTED TRANSFER ORDER

Rsync always sorts the specified filenames into its internal transfer list. This handles the merging together of the contents of identically named directories, makes it easy to remove duplicate filenames, and may confuse someone when the files are transferred in a different order than what was given on the command-line.

If you need a particular file to be transferred prior to another, either separate the files into different rsync calls, or consider using --delay-updates (which doesn't affect the sorted transfer order, but does make the final file-updating phase happen much more rapidly).

Since --delay-updates doesn't affect the sorted transfer order, how can it help if we "need a particular file to be transferred prior to another"?

Thanks.

1

how can it help if we "need a particular file to be transferred prior to another"?

Under normal circumstances, files are copied one at a time. So if the order is incorrect, then the "wrong" file can be updated ahead of the other for quite some time.

With --delay-updates, the files are copied over a period of time, but then placed correctly into the filesystem very quickly at the end. The files may be copied out of order, but window of time when someone on the destination might be able to tell that is much smaller than normal.

It doesn't fix the order, but it does make the race condition less likely to lose.

  • Thanks .How does race condition happen and matter here,? – Tim Jan 23 '17 at 12:43
  • Imagine you want to transfer "B", "A", but rsync sorts it as "A", "B". Then after file "A" is placed, the race is between your application noticing "A" is in place without "B" versus rsync getting file "B" in place. – BowlOfRed Jan 23 '17 at 16:45

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.