I want to sync two computers (A and C). Unfortunately I cannot connect from the computer A to the computer C via ssh (no one knows why). This is why I have to use a another computer (B), which is recognized by C.
To sync A and C I build-up two scripts: the first one "sync_A_2_B.sh" (located in A), and "sync_B_2_C.sh" (located in B). Each of those contain rsync instructions.
From A to B:
rsync -av ~/BACK_UP/ username1@blablabla1:/home/BACK_UP/
From B to C:
rsync -av ~/BACK_UP/ username2@blablabla2:/home/BACK_UP/
This works perfect, but it is a bit time consuming. This leads to my question. Would it be possible to perform these actions in one script located in A (""sync_A_2_C.sh) so that the program considers that B is a bridge? I have tied the following, but it does not work:
rsync -av ~/BACK_UP/ username1@blablabla1:/home/BACK_UP/
rsync -av username1@blablabla1:/home/BACK_UP/ username2@blablabla2:/home/BACK_UP/
Nevertheless, it does not work, as source and target cannot be in a remmote desktop at the same time. Is there any possibility to easily perform what I want? Should I use another tool?