aspyct
aspyct

Reputation: 3875

How would rsync behave if the files it is backing up are updated during the process?

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:

  1. User starts updating files from the server and downloads file A
  2. Admin updates the files A and B on the server, creating A' and B'

Question: What will be the third step ?

Upvotes: 2

Views: 810

Answers (1)

Claude
Claude

Reputation: 9980

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

  • put A and B together in one zip/tar file (the administrator/the one updating, has to do this; else files can still be updated between adding the first and second file
  • Use git (or another VCS) as central repository

Upvotes: 3

Related Questions