1847208 Members
3281 Online
110263 Solutions
New Discussion

cpio or tar

 
SOLVED
Go to solution
Rainer von Bongartz
Honored Contributor

cpio or tar

I need to copy a couple of GIGS from one directory to another in a minimum time

From your experience which one will be faster? tar or cpio as shown below

tar -cf - .|(cd dstdir;tar -xpf )
find . | cpio -pudm dstdir

Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
7 REPLIES 7
Justo Exposito
Esteemed Contributor

Re: cpio or tar

Hi Rainer,

What about cp -R?

Regards,

Justo.
Help is a Beatiful word
Ravi_8
Honored Contributor

Re: cpio or tar

Hi Rainer.

I feel that tar is more fatser than cpio.
never give up
H.Merijn Brand (procura
Honored Contributor

Re: cpio or tar

From Bill Hassell's seminar we've learned that

# cd .../src
# find . | cpio -pudlmv .../dest

is by far the fastest and safest way

Check:

# find .../src | wc -l
# find .../dest | wc -l

should be the same

Thank's Bill :)
Enjoy, Have FUN! H.Merijn
Jean-Luc Oudart
Honored Contributor

Re: cpio or tar

This can take sometimes for a few GIGS.
If the directories are within the same file system , this is even worse.

Personally I use cpio.
But if it's huge tranfer, I would backup to tape and restore to the new directory.

Jean-Luc
fiat lux
Judy Traynor
Valued Contributor
Solution

Re: cpio or tar

I recently did about 140 gigs with cpio
did only the following

cd /start_dir
find . -depth -print | cpio -pd /dest_dir

Threw it into a script (was replacing an array, and copied from /homexx to /newhomexx.

I found this to be efficient (make sure you do not use -v anywhere, and you will be fine.)
Sail With the Wind
harry d brown jr
Honored Contributor

Re: cpio or tar

Rainer,



MIRROR it!!!!

Break the mirror and kabang you have a COPY!!!!!!


live free or die
harry
Live Free or Die
Darrell Allen
Honored Contributor

Re: cpio or tar

Hi Rainer,

I used tar until Bill Hassell pointed me towards cpio -pudlmv. It is indeed much faster.

I prefer to omit the "v" option because of the time it takes to display filenames on the screen.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)