LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   consecutive rsync between three machines (http://www.linuxquestions.org/questions/linux-newbie-8/consecutive-rsync-between-three-machines-610860/)

horacioemilio 01-03-2008 11:24 AM

consecutive rsync between three machines
 
Hi,

I am developing a program on my local machine (machineA). Once I make modifications I have to send the modified files to an external machine (machineC)which is on some network, which is inside another network (accessable through machineB).

For that purpose I wrote the following script;

I use like; ./send_to_machine_C_the_folder.sh folder_name


Code:

#!/bin/bash

# 1. send from machineA to machineB
rsync  -r $1 machineB:~/$1 --exclude "*.o" --exclude "*.ncb"

# 2. send from machineB to machineC
echo " rsync -r  $1 machineC:~/$1 --exclude "*.o" --exclude "*.ncb"    " | ssh machineB

# 3. send from machineC to machineD
echo " echo " rsync -r  $1 machineD:~/$1  --exclude "*.o" --exclude "*.ncb"
  " | ssh machineC " | ssh machineB

But I found the problem that when I modify files on machine A and run this script, I can not get the modifications on machineD.

Do you know what could be the cause of the problem or a better method to do this ?

P.D. I can not use CVS in none of these machines.

hob 01-05-2008 03:12 PM

Quote:

Originally Posted by horacioemilio (Post 3009957)
Hi,

I am developing a program on my local machine (machineA). Once I make modifications I have to send the modified files to an external machine (machineC)which is on some network, which is inside another network (accessable through machineB).

Hi,

Where does machine D come into this?

chrism01 01-05-2008 08:08 PM

Here's an alternative possibility; given

boxA --boxB--boxC

you can use scp from boxB to say

scp user@boxA:/dir/files user@boxC:/tgt_dir

ie you can copy directly between 2 boxes, running the cmd from a 3rd box.


All times are GMT -5. The time now is 08:45 PM.