Move file from 1 server to another


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Move file from 1 server to another
# 1  
Old 04-09-2009
Move file from 1 server to another

I have built out 2 servers on the same LAN. I'm connecting with ssh from my laptop remotely.

I need to copy a file from one server to another. How do I do that? I'd also like to know how to copy a directory.

thanks.
# 2  
Old 04-09-2009
man scp

Code:
Copy a file:
scp /path/to/file  <username>@<Other Server>:/path/to/newfile

Copy a directory:
scp -r /path/to/file  <username>@<Other Server>:/path/to/newfile

# 3  
Old 04-09-2009
Ok. I'll give it a go. thanks for fast reply.
# 4  
Old 04-09-2009
scp /path/to/file administrator@192.168.0.1:/path/to/newfile

If may file (test) is in the home directory of the first server and named test, then moving to the home directory of the other server...what would this command look like?

scp /cd/to/test administrator@192.168.0.1:/cd/to/newfile?

I'm getting connected to the other server but file not moving. My path is not right. Do I have to name the file with a new name when I create it on the other server?
# 5  
Old 04-09-2009
You dont have to name the file on the other end.
Code:
scp /cd/to/test administrator@192.168.0.1:/cd/to/

# 6  
Old 04-09-2009
This is what I get back when I do the command. No such file or directory. See anything wrong?

administrator@ubuntu01:~$ ls
filetoserver woody_folder woody_folder1
administrator@ubuntu01:~$ scp /cd/to/filetoserver administrator@192.168.0.1:/cd/to/
administrator@192.168.0.1's password:
/cd/to/filetoserver: No such file or directory
administrator@ubuntu01:~$
# 7  
Old 04-09-2009
Your NOT really using /cd/to/filetoserver right?

Assuming the file "filetoserver" is located in "/home/administrator"

Code:
scp /home/administrator/filetoserver administrator@192.168.0.1:/home/administrator/

 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Red Hat

Move a LUN from one server to the other

I have NetApp LUN that was presented to a Red Hat Enterprise Linux Server release 5.7 (Tikanga) machine. But this LUN has already data, because it was being used on another server. I can see the new LUN when running fdisk: fdisk -l | egrep '^Disk' | egrep -v 'dm-' | grep -v identifier Disk... (15 Replies)
Discussion started by: fretagi
15 Replies

2. Shell Programming and Scripting

How to move the older than 30 file to another ftp server

Hi All I need to move the older than 30 days file to another ftp server. I have source structure like this Files folder Folder1 Folder2 Folder3 I need to create same Target structure and I need to move the older than 30 day file to another ftp server, can you please suggest me how I develop... (1 Reply)
Discussion started by: murari83.ds
1 Replies

3. Shell Programming and Scripting

remove the special characters and move the file into another server

(5 Replies)
Discussion started by: number10
5 Replies

4. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

5. AIX

Large file move from one server to another

I Have two AIX 5.3 servers. I want to move a 45GB file from Server B to Server A. Can I achieve this with using Tivoli? Or how could I achieve this, by mounting a directory from server B to server A? Any help apreciated! (14 Replies)
Discussion started by: tfort73
14 Replies

6. IP Networking

Dedicated Server Move

I just moved a dedicated server, which included moving to a new subnet, and new IP address. Now my server is not reconnecting - I've tried ifconfig, altering the etc/hosts file with the new ip address, with no luck. (5 Replies)
Discussion started by: esmerika
5 Replies

7. Shell Programming and Scripting

how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this? thanks in advance! Im a newbie to this... (4 Replies)
Discussion started by: forevercalz
4 Replies
Login or Register to Ask a Question