Currently doing some R&D about file synchronization, I eventually stumbled upon rsync (who wouldn’t ?).
Context: There’s a server used as central file repository, that is updated only by an admin. Several users synchronize their filesystem from the central repo. It’s one-way sync, meaning that users will never update the repository. The updates are made with rsync.
Let’s consider a little scenario:
- User starts updating files from the server and downloads file A
- Admin updates the files A and B on the server, creating A’ and B’
Question: What will be the third step ?
- User downloads B’. He has A and B’, resulting in an inconsistent state among files
- User downloads B. He has A and B, resulting in a consistent but outdated state
- User downloads B’ and A’, resulting in a consistent and up-to-date state
- Anything else ?
As far as I know, it’s your first option: User will have A and B’. The only way to avoid this is to snapshot your filesystem before the rsync, but somehow this feels like massive overkill.
Other solutions might be