Due to a Hard disk problem I am trying to shift a partition from one hard disk to another. I am following http://www.ibm.com/developerworks/library/l-partplan.html article to do that. In the copying part I would like to ignore one particular sub directory. How can I accomplish that keeping in mind when copying I have to preserve my owner group and time stamp. There is around 700 GB of data that needs to be copied if I do not ignore a particular subdirectory.
feedback
|
|
rsync -ax --exclude [relative path to directory to exclude] /path/from /path/to you might want (or not) to use --del as well, check the manual page | ||||
|
feedback
|
|
Normally I use cpio as follows, cd source_dir; find . -depth | cpio -pdmv dest_dir And since this is a pipeline you can put a "subtraction filter" in the middle. cd sourcedir; find . -depth | grep -v exclude_dir | cpio -pdmv dest_dir or you could split this is into several steps, cd source_dir; find . -depth > files.lst gedit files.lst (take out the offending directory and files and save back to files.lst) cpio -pdmv dest_dir < files.lst Of course I'd test this on something smaller first but you get the idea. Hotei | |||
|
feedback
|
|
You could write a simple bash script with a loop to ignore the certain path you don't want copied and copy the rest. Another solution could be to us regular expressions. You can read up on bash scripting here -> http://tldp.org/LDP/Bash-Beginners-Guide/html/Bash-Beginners-Guide.html Regex tutorial here -> http://www.regular-expressions.info/ | |||
|
feedback
|
|
Can you temporarily move ( | |||||||||
feedback
|
|
You could write a simple bash script with a loop to ignore the certain path you don't want copied and copy the rest. Another solution could be to us regular expressions. You can read up on bash scripting here -> http://tldp.org/LDP/Bash-Beginners-Guide/html/Bash-Beginners-Guide.html Regex tutorial here -> http://www.regular-expressions.info/ | |||
|
feedback
|
|
Rather ugly solution but... why not just cp everything in the directory non recursively, and then copy the individual directories over recursively? | |||
|
feedback
|