Linux – order of transfer all files under a directory by rsync

linuxrsync

If transfer all files under a directory by rsync, what is the order that rsync determines to transfer the files one by one?

At first it looked like rsync transfers files in alphabetical order, but later I found rsync skipped some files in the first sweep through the alphabetic order, and then went back to transfer files that were skipped in the first time and this time still in alphabetic order.

Thanks and regards!

Best Answer

I believe that it transfers the files in the order that they are listed in the directory entry for the directory that they are in. This is generally the order that the files were added to the directory, but if a files is deleted, its spot will be used by the next file added to the directory. You can see this by using ls -f. If you are really interested in the gory details, try man readdir on Linux or man dir on OS X.

Related Question