RSync - Upload
RSync takes place between a client and a server, and occur in two directions: Upload and download.
During an upload, the client uploads a new version of the file to the server.
During download, the server holds the new version of the file, and the client the old version. The client then needs to download the new version of the file from the server. This situation could arise if a different client had uploaded the new version to the server.
In this text I will focus on upload.
The Upload Process
The diagram below shows the process involved in an RSync upload. This diagram also shows some of the components in play internally on the client and the server. Interestingly, during a download (the reverse process), the same components will be in play, but on opposite computers. You will see, once you see the download diagram in the next text in this tutorial.
The diagram is scaled down. Click the diagram to get a larger version.
|RSync: The upload process.
Here is a break down of the process:
- Client sends file name to server, of file to synchronize.
- Server calculates checksums of old version of file, and returns them to client.
- Client detects differences between new and old version of the file, and send merge instructions to server.
- Server merges old file with differences detected in new file, and sends back an OK/FAIL status code.