cancel
Showing results for 
Search instead for 
Did you mean: 

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
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
-
Caesar_3
Esteemed Contributor

Re: Best way to copy files

Hello!

Using tar is fast:
tar cf - | (cd ; tar xf -)

But if you will give more information about
the copy that you intresting it maybe change
the answer.


Caesar
malay boy
Trusted Contributor

Re: Best way to copy files

fast?? this what we do here.I assume you trying to archive minimum down time for the database.For database cold backup,we copy the datafile to the disk.As the disk is big we used a gzip.

So the step are :

1) shutdown database.
2) copy to the disk.
3) startup database.
4) copy the disk to tape.

For a critical machine,we do :

1) shutdown database.
2) split the mirror.
3) start the database.
4) mount the split mirror.
5) backup the mirror to tape.
6) join back the mirror.

regards
mB
There are three person in my team-Me ,myself and I.
RAC_1
Honored Contributor

Re: Best way to copy files

I will exclude -v options in cpio for better speed.
There is no substitute to HARDWORK