How to copy folder from one server to remote one using SSH


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to copy folder from one server to remote one using SSH
# 1  
Old 08-24-2009
How to copy folder from one server to remote one using SSH

ok guys.

I have a Centos server running a large website I own. Its is severely struggling under the load and I am having to move to a new load balanced setup.

The servers are both remote (to me) and although I can do most things admin wise in nix, I am struggling a bit to come up with a way to transfer 4 GB of folders (one main and lots of subfiles and directories.)

I was thinking SFTP or FTP but Im not 100% on the command to use.


example info/



Server A - (the one with site on) IP 11.222.333.444

Server B - IP 12.222.333.444

For both servers

user: root
Password: password

The directors I want to copy from Server A to server B

/var/www/html/site.com/




All help is appreciated Smilie

---------- Post updated at 06:34 PM ---------- Previous update was at 05:07 PM ----------

ok, I am able to connect to the remote machine and used SCP



scp /var/www/html/mysite root@server******:/user/folder1

then entered the relevant password. All looked fine but then I am getting this


Code:
/var/www/html/mysite: not a regular file



What do I need to change to get it to copy the whole directory??????? and all subdirectories and files? thanks


edit//


SOlved it now. Sorry mods, please close this thread or leave for others who need this info

i had forgotten to user the recursive command. (its late!!)

Got it copying over now


scp -r /var/www/html/mysite root@server1.*******:/tmp/mysite/

Last edited by anderow; 08-24-2009 at 08:39 PM..
# 2  
Old 08-24-2009
scp -r
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do you compare two folders and copy the difference to a third folder in a remote server?

How do you compare one local folder and a remote folder and copy the difference to a third folder in a remote folder.e.g. Folder A -- Is in a remote server and it has the following files TEST1.OUT TEST2.OUT TEST3.OUT Folder B --Is in a local server and it has the following files ... (5 Replies)
Discussion started by: cumeh1624
5 Replies

2. Shell Programming and Scripting

Multi server access through remote server using ssh

Team, Presently I have 5 ip address kept in ip_abc1 file, for each of the ip address listed, i need to login on each ipaddress one at a time and login as below for that specific ip address ssh -p 8101 karaf@<ip.address_for the specific ip address as logged in> password features:list... (4 Replies)
Discussion started by: whizkidash
4 Replies

3. Shell Programming and Scripting

Copy one file from a server to a local folder

Hi, Is there a way I can copy a file from a server to a local folder (i.e. My Documents)? can it be done by scp? I tried this but it just rename the file as the folder it has to be transferred at. scp -r name@some_server:/home/user/file.txt 'somehere\home\home_dir' Thanks. (4 Replies)
Discussion started by: erin00
4 Replies

4. Shell Programming and Scripting

Copy folder and files from unix server to linux server

We would be migrating unix solaries to Linux redhat. Basically source is unix and target is linux. i would like to copy entire file system unix/source/* to target linux/souce/* but target linux has only folder setup so what ever files copied need to be placed in the linux server with same... (8 Replies)
Discussion started by: balajikalai
8 Replies

5. UNIX and Linux Applications

Need to copy the latest file from Unix server to Shared folder

Hi All, One job in unix server will generate .csv files daily. I need to copy the latest of these .csv file from the unix server to the shared drive/folder in windows through unix script. My shared folder will look something like W:\some folder(for example). Could any one of you please help... (3 Replies)
Discussion started by: jaya@123
3 Replies

6. UNIX for Dummies Questions & Answers

Copy files from remote server

Hi Friends, Could you please help me as per my requirement mentioned below ? I have to copy files from one unix server to another unix server, and the files that i need to copy from the remote server are only those which are modified/created Today from abc directory on the remote server (1 Reply)
Discussion started by: ramask
1 Replies

7. Shell Programming and Scripting

copy files from remote server (B) to target server (A)?

Hi All, what is the comand to log off the remote server? I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is: login the remote server: ================= ssh hostB cd /data/test find . -mtime -7 -ls | awk '{print... (4 Replies)
Discussion started by: Beginer0705
4 Replies

8. UNIX and Linux Applications

Copy folder and its contents from HP Unix server to RH Linux

I am trying to copy a folder and all its contents from HP Unix box to RH linux, using the following. rsync -avz -e "ssh" /users/www/webroot/docFiles/Division/Ctry ftpuser@10.4.xxx.yz:/data/webroot/development/contentfiles/webroot/docFiles/Division/Ctry/QAfiles And it throws a consistent... (2 Replies)
Discussion started by: FanTom
2 Replies

9. Shell Programming and Scripting

Copy a file on remote server

I have ssh keys setup and running properly between two servers. I have a Korn shell script that is logging into the remote server and needs to backup the authorized_keys and/or authorized_keys2 files. The following syntax works perfectly ------------------------------------- ssh... (1 Reply)
Discussion started by: sunsysadm2003
1 Replies

10. UNIX for Dummies Questions & Answers

copy folder from one server to another

Dear ALL I have two Sco Unix ver 5.0.5 servers and i want to copy one folder from server A (IP 192.168.0.1) to server B(IP 192.168.0.2). I want a script file using maybe "ftp" to do the job Kindly any help (11 Replies)
Discussion started by: sak900354
11 Replies
Login or Register to Ask a Question