So you have tightened security on your main server by changing the default port number.
Once a week to backup your server data by using the rsync application on a local backup server – possibly even running a crontab script.
All of a sudden you get errors such as:
ssh: connect to host port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-24.1/rsync/io.c(359)
Why is this ???
The option rsh allows the desired port to be specified through ssh.
In the following example, the -r option specifies ‘recursive’; -z enables compression; –rsh=’ssh -p1234′ tells rsync to use port number 1234 for transfers/connection.
The code would look something like this:
rsync -r -z --rsh='ssh -p1234' /dir1 firstname.lastname@example.org:/rdir --progress --stats
That’s it enjoy