Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to copy folder from one server to remote one using SSH Post 302347038 by anderow on Monday 24th of August 2009 07:34:15 PM
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..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
KAS_UNLOCK(8)						       AFS Command Reference						     KAS_UNLOCK(8)

NAME
kas_unlock - Unlocks a locked user account SYNOPSIS
kas unlock -name <authentication ID> [-admin_username <admin principal to use for authentication>] [-password_for_admin <admin password>] [-cell <cell name>] [-servers <explicit list of authentication servers>+] [-noauth] [-help] kas u -na <authentication ID> [-a <admin principal to use for authentication>] [-p <admin password>] [-c <cell name>] [-s <explicit list of authentication servers>+] [-no] [-h] DESCRIPTION
The kas unlock command unlocks the Authentication Database entry named by the -name argument. An entry becomes locked when the user exceeds the limit on failed authentication attempts, generally by providing the wrong password to either an AFS-modified login utility or the klog command. Use the kas setfields command to set the limit and the lockout time, and the kas examine command to examine the settings. To unlock all locked user accounts at once, shutdown the kaserver process on every database server machine, and remove the /var/lib/openafs/local/kaauxdb file from each one. The kaserver process recreates the file as it restarts. OPTIONS
-name <authentication ID> Names the Authentication Database entry to unlock. -admin_username <admin principal> Specifies the user identity under which to authenticate with the Authentication Server for execution of the command. For more details, see kas(8). -password_for_admin <admin password> Specifies the password of the command's issuer. If it is omitted (as recommended), the kas command interpreter prompts for it and does not echo it visibly. For more details, see kas(8). -cell <cell name> Names the cell in which to run the command. For more details, see kas(8). -servers <authentication servers>+ Names each machine running an Authentication Server with which to establish a connection. For more details, see kas(8). -noauth Assigns the unprivileged identity "anonymous" to the issuer. For more details, see kas(8). -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
In the following example, an administrator using the "admin" account unlocks the entry for "jones": % kas unlock -name jones -admin_username admin Administrator's (admin) Password: PRIVILEGE REQUIRED
The issuer must have the "ADMIN" flag set on his or her Authentication Database entry. SEE ALSO
kas(8), kas_examine(8), kas_setfields(8), klog(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 KAS_UNLOCK(8)
All times are GMT -4. The time now is 12:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy