1834249 Members
2423 Online
110066 Solutions
New Discussion

copying file systems

 
golfnut
Frequent Advisor

copying file systems



how can i copy file systems what have other file systems underneath the tree.

I have /opt and /opt/sybase /opt/...

I was using tar.
cd /var; tar -cvf - . | (cd /new_var; tar -xvf -)

This copies everyting..


Any ideas??

htanks
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: copying file systems

try find with cpio:

cd /var; find . -print |cpio -pdumxls /newvar


Pete

Pete
Victor Fridyev
Honored Contributor

Re: copying file systems

Hi,

You can use find dirname -xdev | cpio ....

HTH
Entities are not to be multiplied beyond necessity - RTFM
golfnut
Frequent Advisor

Re: copying file systems

Will the find not traverse the whole /opt directory tree.

How about

dump 0f - /opt | (cd /new_opt; restore xf -)

I used to use this in Tru64 world.

thanks

Victor Fridyev
Honored Contributor

Re: copying file systems

Hi

-xdev option causes find to avoid file system mount point.

HTH
Entities are not to be multiplied beyond necessity - RTFM
Sudeesh
Respected Contributor

Re: copying file systems

Hi,
We usually use

cd var
find . -depth -print | cpio -pdlmv /NEWVAR


Thanks
Sudeesh


The most predictable thing in life is its unpredictability