1829767 Members
5604 Online
109992 Solutions
New Discussion

copy

 
subhashni
Regular Advisor

copy

Hello ,
I'm trying to copy a large data area from a nfs mount point to another directory.I use the command
cd to the source directory
find . -print |cpio -pdum target directory
to copy all the data's from the source to destination. But i would like to eliminate a particular directory (.directory) in this copy process.
Any suggestions ?
thanks so much in advance.
unix4me
6 REPLIES 6
Sandman!
Honored Contributor

Re: copy

cd
find . -path "./dir_to_exclude/*" | cpio -pdum
Victor BERRIDGE
Honored Contributor

Re: copy

Hi,
Try
find ./* -print|cpio -pduml

All the best
Victor
Sandman!
Honored Contributor

Re: copy

Last post was the inverse of what you wanted. Here's the command which negates the path you want excluded:

cd
find . ! -path "./dir_to_exclude/*" -type f | cpio -pdum
subhashni
Regular Advisor

Re: copy

Thanks much for the reply. Does it take so long to see a signle directory in target area. is that usual.
Thanks
unix4me
subhashni
Regular Advisor

Re: copy

Hello ,
i have tried the below syntax to copy all the dir/files recursively from a source directory and eliminate the particular directory "test" to the target directory. Please assist , is any thing wrong in this.
cd find . -name .test -prune -o -print |cpio -pdum
Thank u so much.
unix4me
Jannik
Honored Contributor

Re: copy

it would work! Then it would exclude all files and directories called .test even further down the recusive list (that is not what you want i think).
But on the other hand .test is not that normal a name.

This would do it... even if it is a bit slow.
find ./ -depth | grep -v '\.test' | cpio -dump

I would not use NFS for this type of copy but ssh:
login to the nfs server and go to the source dir and do:
tar cf - . | ssh user@host "(cd ; tar xf - )"
there is the destination of the dump.



jaton