Copying multiple files from remote using rsync over ssh

This is pretty old, but the accepted answer is a bit too strict - multiple files are not necessarily a single argument to rsync. From man rsync:

ADVANCED USAGE
       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}

so OP's command would be

rsync -Pav -e 'ssh -i sshkey' user@remotemachine:/home/user/file1.zip :/home/user/file2.zip :/home/user/file3.zip  .

This is not possible for older versions of rsync, but I think all major distros some with this for several years now.


All remote files should be one argument for rsync. So, just put all remote files in single quotes:

rsync -Pav -e 'ssh -i sshkey' 'user@remotemachine:/home/user/file1.zip file2.zip file3.zip' .

BTW, you can also do this with a Asterisk (the Asterisk will be resolved by the remote shell then):

rsync -Pav -e 'ssh -i sshkey' 'user@remotemachine:/home/user/*.zip' .