Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

copying files between servers using command line

Discussion in 'Command Line' started by EnWorldly, Oct 12, 2018.

  1. EnWorldly

    EnWorldly New Member

    Joined:
    Oct 12, 2018
    Messages:
    3
    Likes Received:
    3
    hi guys,
    I've got a list of files in one server location that I want to copy over to a location on a completely different server. What is the best (and most simple if possible - I'm a bit of a newbie) way to do this?

    The files are all nested inside various subfolders, but I can generate a list of them with their full directory paths.



    thanks in advance for your help
     
    Peer likes this.
  2. Dimitris

    Dimitris New Member

    Joined:
    Apr 7, 2018
    Messages:
    19
    Likes Received:
    16
    Did you try

    1. scp?
    2. ssh in order to wget?
     
    Peer likes this.
  3. EnWorldly

    EnWorldly New Member

    Joined:
    Oct 12, 2018
    Messages:
    3
    Likes Received:
    3

    Nup. Didn't really try anything yet! I do ssh into both of the servers (the source and the target), if that helps? Would you then recommend wget? Should I do that from the source location (where I am copying the files from), or the target location (where I am copying the file to)? thanks!
     
    Peer likes this.
  4. EnWorldly

    EnWorldly New Member

    Joined:
    Oct 12, 2018
    Messages:
    3
    Likes Received:
    3
    wget didn't work, because I'm sftp 'ing into the source location, and wget returned: "Unsupported scheme 'sftp'. "
     
    Peer likes this.
  5. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,547
    Likes Received:
    1,697
    Rsync?

    (Wizard appears in a puff of smoke)

    Welcome to linux.org @EnWorldly :)

    I don't use it myself, but a lot of Sysadmins do!

    Google up

    "linux rsync" and see what you think.

    Cheers and

    Avagudweegend

    Chris Turner
    wizardfromoz
     
    atanere and Peer like this.
  6. HostechSupport

    HostechSupport New Member

    Joined:
    Sep 17, 2018
    Messages:
    1
    Likes Received:
    1
    As per above member said the both scp and rsync commands are useful to

    copy files from remote location.
     
    wizardfromoz likes this.
  7. Rob

    Rob Administrator
    Staff Member

    Joined:
    Oct 27, 2011
    Messages:
    277
    Likes Received:
    754
    Yep, rsync is your best bet here..

    Let's say you want to copy the files from server1:/path/to/files/ to server2:/other/path/ you would simply do:
    From server1:
    Code:
     rsync -avz --progress /path/to/files server2:/other/path/
    From server2:
    Code:
     rsync -avz --progress server1:/path/to/files/ /other/path/
     
    wizardfromoz likes this.

Share This Page