0

I'm verifying my rsync backup's integrity by running the process again with the --dry-run (-n) option added. According to O'Reilly all different files would appear in the terminal output, but what confuses me is that in their example and also in my both tests rsync still reports to have written data. I have a multi-terabyte archive and for me the value was in megabytes.

The first rsync actually performs copying, while the second merely reports differences, thanks to the -n option. If there are no differences, the output will look something like this:

receiving file list ... done
wrote 16 bytes   read 7478 bytes   4996.00 bytes/sec
total size is 3469510  speedup is 462.97

if any files differ, their names will appear after the “receiving file list” message:

receiving file list ... done
/bin/ls
/usr/sbin/sshd
wrote 24 bytes   read 7486 bytes   5006.67 bytes/sec
total size is 3469510  speedup is 461.99
1
  • 3469510 bytes is around 3.5 megabytes. O'Reilly seems to have used a really small sample.
    – user598527
    Sep 5, 2020 at 7:57

1 Answer 1

3

The data written and read refers to the communication of meta data between the source and target rsync processes. There still has to be communication between these to confirm that no meta data has changed and that nothing has to be transferred, and to do this data is written and read across the network connection.

- Hey, this is my list of files, with their types, permissions,
  ownership and stuff.  Is that any different from what you have?
- No, that's exactly what I have.
  (Alternatively: No that's not what I have,
   but we're in dry-run mode so never mind)
- Cool, thanks, seeya later!
- Bye!

The larger the list of files is, the more data has to be communicated across the network connection to confirm that nothing has changed.

When using -n or --dry-run, you basically tell rsync to do this communication of file lists and meta data but without updating files on disk even if things are different between the source and target. To do this, data still has to be transferred.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .