I'm encountering some file corruption when using rsync (that is, the file contents do not match the source file). I can understand the file becoming corrupt if it is being written to while being synced, but I don't think it is being written to. Could corruption occur in these other cases?
1. The file is being synced by multiple rsync processes concurrently.
This seems like an unnecessary and possibly dangerous thing to do. But let's suppose it's necessary. I imagine that the two rsync processes sync the source to two separate temporary files. When each is done, it performs an atomic rename to replace the destination file with the temporary. I don't see how this could cause corruption. At worst, I can see the earlier rsync finishing last and causing the destination file to be synced to a potentially older version of the file.
2. The source file is moved/renamed onto during syncing.
That is, another file is renamed to have the same name as the file currently being synced from. Supposing the rsync process on the source end opens the source file once and only once, I don't see how this can cause corruption. When a file is renamed to take the place of the source, the file that rsync has open doesn't change. It should continue operating on the original, unmodified (assuming no process is writing to it) source.
I'm probably making incorrect assumptions about how rsync works. Feel free to correct any mistakes.