LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2008, 11:24 AM   #1
horacioemilio
Member
 
Registered: Dec 2007
Posts: 61

Rep: Reputation: 15
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.
 
Old 01-05-2008, 03:12 PM   #2
hob
Senior Member
 
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
Quote:
Originally Posted by horacioemilio View Post
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?
 
Old 01-05-2008, 08:08 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync between multiple machines Maeltor Linux - General 7 07-31-2006 11:22 PM
LXer: Akibia Completes 18th Consecutive Year of Profitability and Growth LXer Syndicated Linux News 0 06-29-2006 02:54 PM
consecutive 'write's or 'send's on a socket ananthbv Programming 2 09-26-2005 03:51 AM
Add consecutive numbers to a Chinese file tcma Linux - General 0 10-19-2004 03:25 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration