Operating System - HP-UX
1834789 Members
2814 Online
110070 Solutions
New Discussion

Re: find/cpio combination drops some link file

 
SOLVED
Go to solution
George Liu_2
Frequent Advisor

find/cpio combination drops some link file

I used
find . -xdev -depth -print |cpio -pxdm /mnt
to copy full directories to a new partition, but some files, most of them are symbolic links, were droped. Any idea?
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: find/cpio combination drops some link file

Hi George:

Try adding the '-follow' to 'find' (despite what the man pages say).

Regards!

...JRF...
Bernie Vande Griend
Respected Contributor

Re: find/cpio combination drops some link file

I think you're missing some options on the cpio that will retain symbolic links. (-l)
This is the command that I use:

find . -depth -print | cpio -plvdmu /outputdest



Ye who thinks he has a lot to say, probably shouldn't.
harry d brown jr
Honored Contributor

Re: find/cpio combination drops some link file

Why not use "cp -rp /currdir /mnt" instead of the find & cpio??
Live Free or Die
Carlos Fernandez Riera
Honored Contributor
Solution

Re: find/cpio combination drops some link file

I dont use -depth. As root i think you dont need that option.


-follow option copy contents rather than links.

i use:

find /fs -xdev -print | cpio -pdumx

And no problem ( as root).
unsupported
George Liu_2
Frequent Advisor

Re: find/cpio combination drops some link file

Carlos is right. It seems -depth caused the problem. However, how to preserve the timestamp for the files? Thanks.