bunn (bunn) wrote,

Copying files direct from one server to another server with Secure CoPy (SCP) and SSH shell access

I don't need to do this all that often, so it is quite irritating to me that I knew how to do this back in May, but I didn't quite finish the job for some reason, and then when I came back to it, I couldn't remember how I did it or find any notes about it. Grrr!

So, I figured out how to do it again. And now here I am making notes in public, where the world can Google it if they want to, and so can I.

I SSH'd into Server1, where I found the files I wanted stashed in this directory: /domains/t/h/thiswebsite.com/web/public_html

Then I checked Server2 to find out where I wanted to put the files. Ah yes, in /home/thiswebsite/public_html (different directory structure on Server2, just to make my life more exciting apparently).

So I did this:

scp -rp /domains/t/h/thiswebsite.com/web/public_html account@domainname.com:/home/thiswebsite/public_html

Only then I found that user account, on domainname.com did not have shell access. In a moment's foolishness, I switched to root access. But this doesn't work (fortunately) - you can't just scp right in when you are root. The thing to do was to change account@domainname.com so that he had shell access. So I did that, and it worked. Hurray! A pile of monster files copied direct.

more helpful instructions here.
Tags: internet, work

  • Theo the Small Gentleman

    Last week, Theo was castrated. I had thought of letting him stay entire for a while longer — the thinking now seems to be that…

  • Dogs, Beach, etc

    It was probably a bit rash to venture to a sandy beach in August, but this one has a lot of dunes,and not that much car parking, so most of the…

  • Theo

    Theo's recall is definitely improving. I mean, I wouldn't rely on it around livestock and I'm very cautious on the local golf…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded