rsync multiple remote directories to local machine preserving directory paths

Directly from the rsync man page:

The syntax for requesting multiple files from a remote host is done
by specifying additional remote-host args in the same style as the 
first, or with the hostname omitted.  For instance, all these work:

    rsync -av host:file1 :file2 host:file{3,4} /dest/
    rsync -av host::modname/file{1,2} host::modname/file3 /dest/
    rsync -av host::modname/file1 ::modname/file{3,4}

This means your example should have a space added before the second path:

rsync -e ssh root@remote.com:/path/to/file :/path/to/second/file/ /local/directory/

I’d suggest you first try it with the -n or --dry-run option, so you see what will be done, before the copy (and possible deletions) are actually performed.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)