I have been attempting the following command:
rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path
SSH is running on port
Another option, in the host you run rsync from, set the port in the ssh config file, ie:
cat ~/.ssh/config
Host host
Port 2222
Then rsync over ssh will talk to port 2222:
rsync -rvz --progress --remove-sent-files ./dir user@host:/path
The correct syntax is to tell Rsync to use a custom SSH command (adding -p 2222), which creates a secure tunnel to remote side using SSH, then connects via localhost:873
rsync -rvz --progress --remove-sent-files -e "ssh -p 2222" ./dir user@host/path
Rsync runs as a daemon on TCP port 873, which is not secure.
From Rsync man:
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST
Which misleads people to try this:
rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path
However, that is instructing it to connect to Rsync daemon on port 2222, which is not there.