How to copy directory from one server to another

Discussion in 'Site & Server Administration' started by GloBleeOne, May 24, 2008.

  1. #1
    I need to transfer one directory from one server to another, how can I do this.

    There is about 5000 files in there, and about 3GB of data.

    Can I do it via SSH?
     
    GloBleeOne, May 24, 2008 IP
  2. cmanns

    cmanns Peon

    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Read about scp...
     
    cmanns, May 24, 2008 IP
  3. GloBleeOne

    GloBleeOne Peon

    Messages:
    286
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok, found some info, but seem to be able to only use that to transfer 1 3GB file. How can I use that to transfer each file.....

    scp /home/*******/public_html/****photos/* ssphotos@202.*.*.*:/home/*******/public_html/****photos/

    Comes back saying "Argument list too long"

    Any thoughts?
     
    GloBleeOne, May 24, 2008 IP
  4. xous

    xous Active Member

    Messages:
    173
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Hi,

    Use rsync.

    (running on source server)
    rsync -av /home/user/public_html user@destination.server.com:/home/user

    the user@ part is optional if the account names are the same on both servers.

    Edit: also I should mention that you are not using the best arguments for scp -r /home/user/public_html :/home/ssphotos
    Note that scp will not copy hidden files and rsync is generally a better choice for large transfers.
     
    xous, May 24, 2008 IP