Can you tell me why rsync is saying my files are different

I’m using rsync to sync files from my NAS to a Remote Server. The files on the Remote Server appear to have the same user, group and permissions as the source. However rsync wants to copy the files anyhow.

Here is the output from my NAS to my Remote Server:

root@omv:/share/Music# rsync -auHs --dry-run --progress --itemize-changes --numeric-ids -e ssh /share/Music/Bond/Born user@somedomain:/home/user/media/Music/Bond/Born
sending incremental file list
cd+++++++++ Born/
<f+++++++++ Born/01 Bond - Quixote.flac
<f+++++++++ Born/02 Bond - Winter.flac
<f+++++++++ Born/03 Bond - Victory.flac
<f+++++++++ Born/04 Bond - Oceanic.flac
<f+++++++++ Born/05 Bond - Kismet.flac
<f+++++++++ Born/06 Bond - Korobushka.flac
<f+++++++++ Born/07 Bond - Alexander The Great.flac
<f+++++++++ Born/08 Bond - Duel.flac
<f+++++++++ Born/09 Bond - Bella Donna.flac
<f+++++++++ Born/10 Bond - The 1812.flac
<f+++++++++ Born/11 Bond - Dalalai.flac
<f+++++++++ Born/12 Bond - Hymn.flac
<f+++++++++ Born/13 Bond - Victory (Mike Batt Mix).flac
<f+++++++++ Born/Folder.jpg
root@omv:/share/Music#

Here is the checksum on the NAS:

root@omv:/share/Music# sha256sum 'Bond/Born/'*
d510925c0cba8b01b4d95935248ef5b863e4ed9a7e8c7e537b3acbd18767c882  Bond/Born/01 Bond - Quixote.flac
5dd40480fdc1ca7d20bfa3696c99a8b918636be2af7e59101d4cd9b04726dd44  Bond/Born/02 Bond - Winter.flac
b0c1236caf10c1a4c04ee4cce16d9b2d47e6a5fecfcc8fabd513c585a4156039  Bond/Born/03 Bond - Victory.flac
4348e1502c36b0824742e4c47544efee2b3040626fdd94f937634b55c6736c1f  Bond/Born/04 Bond - Oceanic.flac
8e8bbf0817d1625a183547b31e60d9677bb454d18bb6c2b14ed7729a8acb4627  Bond/Born/05 Bond - Kismet.flac
19b0ea2b2f2ad45bb3cee3876037b238fa9a5915eccf44c766262de17085ff33  Bond/Born/06 Bond - Korobushka.flac
37fa58c31263aeb475ace4760b86d26fbf130a47bf80e51c61b4b2e0e003fa07  Bond/Born/07 Bond - Alexander The Great.flac
6ad69fe39d57b7be43538c36a674ed89492d805087319a386bb8ddda78ae364e  Bond/Born/08 Bond - Duel.flac
ae3de5d17b1ad56ce1d6ef7323532c015f863ab1548c198cdac41386e56c46d3  Bond/Born/09 Bond - Bella Donna.flac
ab85604b04ad72cc01a886d61b437354ee2eb058fe5d1188199c360445d4c926  Bond/Born/10 Bond - The 1812.flac
6babc0a824b42375efa5d584dd1662687022f9830d16c70504b2e1b86c17e71a  Bond/Born/11 Bond - Dalalai.flac
11f2ad493c5c0d8beee89a00e9502010421579cffc941fe3d1e72cdd70a5f12b  Bond/Born/12 Bond - Hymn.flac
b15ad119dfd14a76d5fd47ce5993a6ebccec10171f1e58f5238bf830f05a3134  Bond/Born/13 Bond - Victory (Mike Batt Mix).flac
537e3ab0f6cf762319e36b19a786951d507d66dc26ea6409f4000cac508a58ab  Bond/Born/Folder.jpg

Here is the checksum on the Remote Server:

user@10:~/media/Music$ sha256sum 'Bond/Born/'*
d510925c0cba8b01b4d95935248ef5b863e4ed9a7e8c7e537b3acbd18767c882  Bond/Born/01 Bond - Quixote.flac
5dd40480fdc1ca7d20bfa3696c99a8b918636be2af7e59101d4cd9b04726dd44  Bond/Born/02 Bond - Winter.flac
b0c1236caf10c1a4c04ee4cce16d9b2d47e6a5fecfcc8fabd513c585a4156039  Bond/Born/03 Bond - Victory.flac
4348e1502c36b0824742e4c47544efee2b3040626fdd94f937634b55c6736c1f  Bond/Born/04 Bond - Oceanic.flac
8e8bbf0817d1625a183547b31e60d9677bb454d18bb6c2b14ed7729a8acb4627  Bond/Born/05 Bond - Kismet.flac
19b0ea2b2f2ad45bb3cee3876037b238fa9a5915eccf44c766262de17085ff33  Bond/Born/06 Bond - Korobushka.flac
37fa58c31263aeb475ace4760b86d26fbf130a47bf80e51c61b4b2e0e003fa07  Bond/Born/07 Bond - Alexander The Great.flac
6ad69fe39d57b7be43538c36a674ed89492d805087319a386bb8ddda78ae364e  Bond/Born/08 Bond - Duel.flac
ae3de5d17b1ad56ce1d6ef7323532c015f863ab1548c198cdac41386e56c46d3  Bond/Born/09 Bond - Bella Donna.flac
ab85604b04ad72cc01a886d61b437354ee2eb058fe5d1188199c360445d4c926  Bond/Born/10 Bond - The 1812.flac
6babc0a824b42375efa5d584dd1662687022f9830d16c70504b2e1b86c17e71a  Bond/Born/11 Bond - Dalalai.flac
11f2ad493c5c0d8beee89a00e9502010421579cffc941fe3d1e72cdd70a5f12b  Bond/Born/12 Bond - Hymn.flac
b15ad119dfd14a76d5fd47ce5993a6ebccec10171f1e58f5238bf830f05a3134  Bond/Born/13 Bond - Victory (Mike Batt Mix).flac
537e3ab0f6cf762319e36b19a786951d507d66dc26ea6409f4000cac508a58ab  Bond/Born/Folder.jpg
user@10:~/media/Music$

All the checksums look OK so why does rsync still want to copy the files to the remote server?

TIA

Asked By: ghines

||

The <s in that dry-run incremental output would indicate that the files would be sent and the +s that they would be created anew. That indicates the files don’t exist on the target.

Your target specification is user@somedomain:/home/media/Music/Bond/Born but you show us:

user@10:~/media/Music$ sha256sum 'Bond/Born/'*

Where ~ represents your home directory. As you can double-check with echo ~, your home directory is unlikely to be /home. More likely it’s something like /home/user, so the target specification should rather be something like user@somedomain:/home/user/media/Music/Bond/Born or just user@somedomain:media/Music/Bond/Born where we use a relative path on the remote server as sshd lands you in your home directory, so that would be a relative path to your home directory on the remote server.

Also, since the source specification (/share/Music/Bond/Born) doesn’t end in a /, that’s asking rsync to create a Born directory inside the target directory, so it will try to create a /home/media/Music/Bond/Born/Born.

Note this important paragraph in the rsync manpage:

A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name"[…]

So the command should look like:

rsync -auHs --dry-run --progress --itemize-changes --numeric-ids -e ssh 
      /share/Music/Bond/Born/ 
      user@somedomain:/home/user/media/Music/Bond/Born
Answered By: Stéphane Chazelas
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.