Search code examples
rsync

Why is rsync daemon truncating this path?


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
H_sapiens/
H_sapiens/README
          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/
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.


Solution

  • See rsync description:

    CONNECTING TO AN RSYNC SERVER

    ...

    Using rsync in this way is the same as using it with rsh or ssh except that:

    • You use a double colon :: instead of a single colon to separate the hostname from the path.
    • The first word of the "path" is actually a module name.

    You can get all module names with

    rsync -HRavP ftp.ncbi.nih.gov::