file transfer from server 1 to server 3

Discussion in 'Programming/Scripts' started by bschultz, Feb 21, 2008.

  1. bschultz

    bschultz Member

    I have a problem. The setup I'm dealing with at work is a router and firewall on the main server (Mac OS X) with ssh. I need to send (via cron job) a directory from my linux server at home to a second machine at work (also Mac OS X)...not the main server.

    So, what I need is this:

    server1 ssh's into server2 which ssh's into server3 and sends the directory. My boss won't let me change the firewall or port forwarding settings to ssh directly into server3.

    I've tried to ssh into server 2 (main server/router) and then ssh into server3 and then scp the files...but I get an "ambiguous target" error.

    Here's my code

    ssh [email protected]
    scp -r /server1directory/ [email protected]:/server3/path
    Any idea what I'm doing wrong?
  2. topdog

    topdog Active Member

    I think it should be the other way round
    ssh [email protected]
    scp -r [email protected]:/server3/path .
    scp -r /server1directory/ [email protected]:/server1/path
    rm -rf /server1directory/
  3. bschultz

    bschultz Member

    thanks a bunch!

Share This Page