I have a directory A, which has a subdirectory B, and the file C.log, I want to put directory A in addition to the B and C.log files and directories to the D directory, in addition to exclude all SVN directory, how to write this statement?
Method One:
Find A (-path A/b-o-path a/*.svn)-prune-o-print |cpio-o >/tmp/a.cpio
Then go to the TMP directory
Cpio-i < A.cpio
Method Two:
Using the rsync command, thank you very much:
rsync -R --Delete --exclude=". SVN"- -Exclude="B" --exclude="C.log" /A/ /D
Much better than the CP command, the other excluded files and directories can also be written into a file:
rsync -R --Delete --exclude-from=rsync. Exclude /A/ /D
The contents of the Rsync.exclude file are:
1 . SVN 2 B 3 C.log
Rsync is particularly good with the window client, which also achieves the same effect under window.
How do I copy an entire directory and ignore some files and directories (including Windows)?