Operating System - HP-UX
1753317 Members
5209 Online
108792 Solutions
New Discussion юеВ

Re: Best way to copy files

 
SOLVED
Go to solution
Theodore Alexopulos
Occasional Advisor

Best way to copy files

Which is the best (accurate and includes everything) and fastest way to copy files?
12 REPLIES 12
Steven E. Protter
Exalted Contributor
Solution

Re: Best way to copy files

If the database is down the cp command will work just fine.

No matter what you do, you will have to know the layout of your database. For oracle the files are rarely just sitting in the same directory.

For copying between systems, avoid rcp it sometimes didn't work for me.

scp, part of Secure Shell works fine.

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
Darren Prior
Honored Contributor

Re: Best way to copy files

Hi,

You'll need to include a little more information... What types of files are you copying, are you copying between disks on one server, or between servers?

Personally, I tend to use the following for copying stuff between dirs on a box:

find /sourcedir | cpio -pdmuxlv destdir

regards,

Darren.
Calm down. It's only ones and zeros...
Cheryl Griffin
Honored Contributor

Re: Best way to copy files

I believe it was Bill Hassell who says the fastest way to copy is:

$ cd /source_dir
$ find . | cpio -pudlmv /destination_dir

omit v (verbose) option from cpio for more speed
"Downtime is a Crime."
James R. Ferguson
Acclaimed Contributor

Re: Best way to copy files

Hi:

If you mean copy for backup purposes, I prefer 'fbackup'. There is automatic retry of files that cannot be backed up because they are changing at the moment of copy (although one hopes not!). There is an index of files built and written to the front of the tape which makes later examination and/or recovery ('frecover') very easy. You can do full and/r incremental backups and you can include and exclude files and/or directories with simple "graph" files. See the man pages for 'fbackup' and 'frestore' for more information.

Regards!

...JRF...
Theodore Alexopulos
Occasional Advisor

Re: Best way to copy files

database files. Database will be offline. About 1 TB on same server, different storage systems.
I am worrying for
a)the integrity of data
b) all required data will be copied
twang
Honored Contributor

Re: Best way to copy files

To store a particular directory:

# fbackup -f /dev/rmt/0m -i /tmp

# find /tmp -print | cpio -oBv > /dev/rmt/0m
# find /etc | cpio -ov > /dev/rmt/0m

# tar cv /tmp ( for default device )
# tar cvf /dev/rmt/1m /tmp (specify device)
Robert-Jan Goossens
Honored Contributor

Re: Best way to copy files

Hi,

# cpio -pcmudv

Robert-Jan.
Yogeeraj_1
Honored Contributor

Re: Best way to copy files

hi,

since it is on the same server, i would also consider doing the copy operations in parallel...

hope this helps too!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Tim D Fulford
Honored Contributor

Re: Best way to copy files

copy over network....

on target machine
remsh "cd ; tar cf - | gzip - " | cd ; gunzip - | tar xf -

This will effectively create a gzipped tar image of the source & simultanously transfer it acros the network & untar it..... nice efficient & simple only in concept.....(probaly be in the offing for the Obfucated perl/tar competition)

Regards

Tim
-