Rsync over ssh with custom port
It’s just a quick tip. How can you force rsync to use a specific port when connecting to remote machine via ssh? Turns out it’s pretty easy, if you dig into man page deep enough. Simply specify needed port in ‘-e’ option like this:
rsync -av -e "ssh -p 123" example.com:/path/on/remote/server ~/local/path
As a bonus, with the same option you can add a lot more useful options, like compression and compression ratio:
... -e "ssh -p 123 -C -oCompressionLevel=9" ...