How to specify remote port in rsync

In connection to my post, wherein my virtual machine can be accessed via ssh on port 2200 of the physical system. Rsync takes port 22 as its default port. So if I want to sync any data on that virtual system, I have to tell rsync on which port it should connect to.

The syntax would be

rsync --rsh='COMMAND' FILE USER@HOST:~

if my remote port is 2200, then

rsync --rsh='ssh -p2200' ubuntu.img andro@darkstar:~

--rsh flag specifies the remote-shell command, here we are using the command ssh with port as 2200.


If you want to see progress of file transfer, add --progress --inplace flags.