I want to rsync files between two remote servers. I tried to follow the next solution of @roaima: https://unix.stackexchange.com/a/183516/137526, but I need a more delicate solution, for two reasons:
- One of the remote server has a non default port for ssh, so I need to specify the port with the -p option.
- I can ssh to both server, but I had to use different usernames, so it has to be explicit specified.
In addition, in the cited solution it is not clear with is the path on the source host and which one is on the destination one, as both appears as /var/www
I have tried different variation of the next command, but w/o success:
ssh -R localhost:50000:username1@dest_host:22 username2@source_host 'rsync -e "ssh -p 50000" -avzt --progress --partial /path/on/source/ localhost:/path/on/destination/'