rsync using ssh over multiple servers
I need to copy file X on server A to server D, going through servers B and C.
So far, I've been able to achieve this in two steps, as follows:
1) ssh -ACt user1@B ssh -ACt user2@C
2) rsync X user3@D:
I would like to combine these steps in one line, which I think should be possible using rsync. I tried this, but it doesn't work:
rsync -avvv X -e "ssh -ACt user1@B ssh -ACt user2@C" user3@D:
The -t option for SSH should force a terminal window to be opened, so I can put in a password, but for some reason, I get warnings saying
"Pseudo-terminal will not be allocated because stdin is not a terminal"
This then leads to more errors along the lines of 'ssh_askpass: no such file or directory' (according to the man pages ssh_askpass only gets called if there's no terminal).
Any ideas? Thanks for your help!