1753785 Members
7143 Online
108799 Solutions
New Discussion юеВ

best way to copy files

 
matthew mills
Frequent Advisor

best way to copy files

I am trying to copy a directory from one HPUX 11.00 to another HPUX 11.00. I do this daily and it is very slow.

rm -r /oradata/*
rcp -pr ngbva:/oradata .

is there a better way? please give me a sample script.

Thanks in advance.


8 REPLIES 8
Sanjay_6
Honored Contributor

Re: best way to copy files

Hi,

You can use any other utility like scp / ftp. But it might still be slow. The whole thing depends on the network speed. Maybe the bottleneck is your network.

also if both your servers are 100 Full Duplex, make sure the server network port as well as the switch is set to 100 Full Duplex / Fixed and there is no auto-neg enabled / involved.

Hope this helps.

Regds
Sridhar Bhaskarla
Honored Contributor

Re: best way to copy files

Hi Matthew,

since 'rcp' is unsecured anyway, try 'ftp' manually and measure the difference. If you find it (it should be) faster, you can script it.

I would suggest you setup ssh on both the boxes, setup public/private key authentication and use 'sftp' non-interactively. It is secured and doesn't require passwords to be supplied or hardcoded in any files.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Dietmar Konermann
Honored Contributor

Re: best way to copy files

Obviously you are copying database files... maybe a good idea to use compression when copying over the network then.

e.g. with tar (max 8GB files with recent tar patch level):

remsh ngbva "cd /oradata && tar cf - . | gzip --fast" | gzcat | tar xvf -

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
matthew mills
Frequent Advisor

Re: best way to copy files

can I compress the file before sending it without taking up space on the host
Steven E. Protter
Exalted Contributor

Re: best way to copy files

Best and most secure.

scp/sftp

authentication is secure which is better than ftp.

You can get better tranfser rate and less network traffic by using gzip ahead of time. There is a substantial price in overall processing and transfer time because gzip is quite efficient, but its not all that fast.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Robert-Jan Goossens_1
Honored Contributor

Re: best way to copy files

Dietmar is using compression in his command (gzcat)
Regards,
Robert-Jan
Paul Cross_1
Respected Contributor

Re: best way to copy files

rsync is another (albeit insecure) option if you trust your network.
matthew mills
Frequent Advisor

Re: best way to copy files

test