Technology / Software / 

27 Dec 2010

Rsync to a custom SSH destination port

If the server/machine that you want to rsync to has SSH running on a nonstandard port (i.e. not port 22), as is quite often the case these days, you have to use the -e option as follows:

Bash rsync -av -e 'ssh -p 5000' /home/joe joe@joeshomeserver.tld:/var/backup/

This would sync the local directory /home/joe to /var/backup/joe (pay attention to the lack of a trailing slash on the source directory) while connecting to the server’s SSH daemon listening on port 5000.