Using Rsync with a Non-standard SSH Port

While using rsync to synchronize files between two servers uses default ssh port 22. But many of hostmaster change the default ssh port for the security purpose, in that situation you also need to specify port to connect remote server.
For example below command connect to example.com server though ssh on port 2222 and sync all files from /files/ directory on example.com to /local/files localhost directory
$ rsync -ravz -e "ssh -p 2222" user@example.com:/files/ /local/files/ 

Thanks for Visit Here

Comments