The —stats option in RSYNC (Remote Sync) is used to provide detailed statistics regarding the file transfer operation. RSYNC is a common open-source software tool used for transferring files between systems in Unix/Linux environments. According to the official RSYNC manual, when —stats is utilized, it gives you statistics about what was transferred and how much of it was improved during the data transfer operation.
When you use the —stats option, RSYNC will display information like total file size, bytes transferred, speed of transfer, and some other statistical data. These data may serve useful for reviewing the efficiency of your file transfer, diagnosing issues, or for refining your use of RSYNC to improve future transfers.
For a practical example, suppose you’re transferring your Pictures collection from a local machine to a remote server. You could use a command such as:
`rsync -a —stats /Users/You/Pictures/ you@yourserver.com:/home/you/Pictures_backup/`
Once the transfer completes, if —stats was specified, you may see output such as:
\`Number of files: 100
Number of files transferred: 40
Total file size: 10000000 bytes
Total transferred file size: 4000000 bytes
Literal data: 4000000 bytes
Matched data: 6000000 bytes
File list size: 1800
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 4000450
Total bytes received: 750\`
This tells you that, out of 100 files and 10 MB of data, 40 files and 4 MB were transferred, with the rest having already been present and unchanged on the remote server.
These particular calculations and the specific output may vary depending on your own file transfer needs and circumstances. The information provided by —stats however, consistently offers valuable insight into what RSYNC is doing during a file transfer operation.
The source used to inform this answer is the following:
- Rsync man page https://linux.die.net/man/1/rsync
This man page is notably reliable and recognized, as it comes from the developers of RSYNC themselves. Thus, for most users, it may be considered the most definitive source of information on how to use RSYNC and what its various options, including —stats, do.