My Initial Question:
What does the --dry-run
option of the rsync command do? On the network where I am currently working, it seems to produce a very long list of files, which isn't very useful.
Here's some further detail:
I recently (finally) got around to deploying a samba share on a TrueNAS box. It has to be samba because I work with both Linux, Windows and occasionally OS X systems, so I want a networked storage location which I can potentially use from all three of those systems if necessary.
I am now currently working my way through moving data from a random array of hard disks to the storage pool on the TrueNAS system. The easiest way I have found of doing this is to use a rsync server on the TrueNAS system, and use rsync on my client to send the data.
Some of the drives I am copying data from have multiple copies of the same directory names. I can't guarantee they are identical however as some of them were made at a later date.
Caveat: I can't rely on the timestamps of the files. Reason: I moved a significant amount of stuff to a single disk before starting this data migration.
Example: I have one disk which is a 3TB drive which contains things like
Documents-backup/...
Documents-backup_2/... # same directory structure as Documents-backup,
# may or may not be identical
then another drive with contains
Documents-backup/... # may or may not be identical to dir on another disk
Some of these folders are significant in size with over 100 GB of content.
All I want to do is use rsync to:
- First check (with dry run and checksum?) if the folders are identical. If they are I can discard/delete one of them, no need to copy it and maintain 2 copies on the NAS
- If they are not identical, give a list of files with different checksums
I thought that the following command would do this:
rsync -a -c --progress --dry-run ./local-path user@ipaddress::rsyncservername/remote-path
However as far as I can tell all this is doing is printing a list of all the files being checked, not the files with differing checksums.
Research / Partial Answer?
I found this question by doing a search for rsync dry-run
. This question mentioned differing permissions. Since I am using the archive switch -a
, I think this preserves permissions. My guess would be that samba doesn't support Linux permissions and that this is causing rsync to believe there is a "difference" between the files despite the checksums being the same.
More meaningful recap of changes in rsync dry-run while backing up the Linuix home folder
So my question is slightly narrower, but essentially still the same. Given the constraints that I have (server must be samba) how can I do an rsync to check for any differences between the files using a checksum?