I have a case when I need to move data from an old server: host1 to a new server: host2. The problem is host1 cannot see host2, but I can use another server (localhost) to SSH to both host1 and host2.
Imagine it should work like this: host1 -> localhost -> host2
How can I use rsync to copy files between host1 and host2? I tried this command on localhost server but it says The source and destination cannot both be remote.
rsync -avz host1:/workspace host2:/rasv1/old_code-de
scp -3 host1 host2
. The option-3
means: "Copies between two remote hosts are transferred through the local host." – eblock Apr 06 '20 at 12:43-3
option, as suggested by eblock, in mine rsync, nor in man pages on the internet (https://linux.die.net/man/1/rsync). Look here: https://unix.stackexchange.com/questions/183504/how-to-rsync-files-between-two-remotes – nobody Apr 06 '20 at 13:25rsync
. – Kusalananda Apr 11 '20 at 09:42