tags:

views:

1167

answers:

6

How do I copy all files inside /directory/subfolder to /directory using SSH?

PS. I'm not going from 1 server to another, I'm just trying copy the files in the subfolder to update the site...

A: 

I believe you are looking for sftp and specifically the put command. Here is some documentation on sftp.

Andrew Hare
+2  A: 

I'm not too familiar with SSH though I have used WinSCP to do what you asked using an SSH connection. It was fairly easy, though I didn't have to deal with the server-side settings.

Blitz Bolt
seems to be working. Just waiting for it to finish.
Hintswen
Worked like a charm. Does it keep any permissions that were set or will I need to set them again?
Hintswen
I believe there is a section in the actual application to save the profile. So I guess you could have it keep the permission if you make a profile.
Blitz Bolt
A: 

scp -r user1@from-server:/dir1 user2@to-server:/dir2

scp -r local-directory user2@to-server:/dir

scp -r user1@from-server:/dir local-directory

arsane
+1  A: 

scp -r /directory/subfolder/* user@host:/directory

Andrew Medico
A: 

Depends on your needs and your underlying OS. If you are on a box with X/windows and are trying copy files, you can use FileZilla, WinSCP and load the files via sftp. Another nice method is to use ExpanDrive, MacFusion, WebDrive (Win/MAC) and simply mount an external directory as a local drive. If you are only interested in a console solution, you maybe want to take a look at "scp".

merkuro
A: 

PULL:

ssh target_address cat remotefile > localfile

ssh target_address dd if=remotefile | dd of=localfile

ssh target_address cat "<" remotefile >localfile

ssh target_address cat "<" remotefile.gz | gunzip >localfile

louis vuitton