I'm trying to synchronize a set of remote files via an rsync daemon, but the resulting path is missing the initial path element.

$ rsync -HRavP ftp.ncbi.nih.gov::refseq/H_sapiens/README 2015-05-11/
receiving incremental file list
created directory 2015-05-11
          4,850 100%    4.63MB/s    0:00:00 (xfr#1, to-chk=0/2)

sent 51 bytes  received 5,639 bytes  3,793.33 bytes/sec
total size is 4,850  speedup is 0.85

$ tree 2015-05-11/
└── H_sapiens
    └── README

Notice that the resulting tree is missing the first part of the remote path ("refseq").

I realize that I can append the first element of the remote path to the destination path, but it seems unlikely (to me) that this is the intended behavior of rsync.

It's worth noting for comparison that rsync -HRavP refseq/H_sapiens/README 2015-05-11/ (where the source is a local file) correctly creates the full relative path under the destination directory.

[Also: https://stackoverflow.com/questions/30177423/]

migrated from serverfault.com May 12 '15 at 11:31

This question came from our site for system and network administrators.

  • 1
    That's because it's not a filesystem path to begin with. You're connecting via the rsync daemon. The first part after the double-colon is the name of the module as configured in the rsync daemon. – yoonix May 11 '15 at 21:09

When using the rsync daemon, the first part of the path is not considered a folder, but more of a repository. The rsync daemon looks up the full path to the files of this repository in its conf file and repository name is trimmed from the path on the destination. To get the behaviour you expect skip the daemon and just use ssh. If you need to get around the password setup ssh keys with 'ssh-keygen' and 'ssh-copy-id'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.