Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two servers, access to SSH on both. I want to transfer entire directory from server A to server B. They are both remote servers to me.

Am I right to assume it is possible to log into SSH terminal on my local PC, connect to server A, and do some magical command that will initiate a transfer between the two servers while being able to log out of terminal on my own local machine?

share|improve this question

migrated from serverfault.com Jun 15 '13 at 23:28

This question came from our site for professional system and network administrators.

3  
Please search for rsync and scp - this question has been answered thousands of time on all kind of sites. –  SvW Jun 15 '13 at 14:41

1 Answer 1

On server A:

$ scp -r /path/to/directory someuser@serverB:/path/to/files/.

The above command will copy the files from serverA to serverB using someuser (a user on serverB). The directory (/path/to/directory) will be copied as a directory to the directory on serverB into the directory /path/to/files/.

share|improve this answer
    
And if you want to log out before the transfer is finished, look into the "screen" command - you can start a screen, start the scp (or rsync) command, and then detach (ctrl+a, ctrl+d) and log out, while everything keeps running remotely inside the screen session. –  faffaffaff Jun 19 '13 at 22:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.