If you’re using rsync through SSH and you need to use a different (non-standard) port, then use the -e
.
The -e
switch lets you use any remote shell you like (including ssh) and use whatever parameters you like.
For example, the following command connects to server.com on port 8888 and performs a dry run:
rsync -e 'ssh -p 8888' -avzn username@server.com:/home/username/public_html/ /local/copy/