1748272 Members
4340 Online
108760 Solutions
New Discussion

Re: file copy

 
rajesh73
Super Advisor

file copy

i wan to copy the file from one server to another server ,with the same file permission.what is the command

6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: file copy

How are the systems connected?

 NFS: cp -p

ftp: tar it up first or use pax(1), cpio(1) or zip.

scp: scp -p

rajesh73
Super Advisor

Re: file copy

please explain for NFS and scp

rajesh73
Super Advisor

Re: file copy

sorry dennis,

thanks for your reply.
rajesh73
Super Advisor

Re: file copy

either p is small letter or capital. pls confirm
Dennis Handly
Acclaimed Contributor

Re: file copy

>either p is small letter or capital.

 

(There is such a thing as cut & paste, it's magic.  ;-)

It's lower case -p.

Spyros_
Advisor

Re: file copy

Hi rajesh73,

 

You can use rcp command:

For example from source_server:


rcp -rp  .../file.tar root@destination_server:.../file.tar

where .../file.tar is the file in the source server and .../file.tar is the file inside the destination server.

If you want to copy one file to the same directory to a remote server you can go to the directory that you want (for example cd /tmp) and then:

 

rcp -rp test.txt hpsep2:$pwd

 

Where test.txt is the file that you want to copy and hpsep2 is the name of your remote server

Best regards,

Spyros