views:

675

answers:

3

I need to recursively copy a directory tree, ignoring any subdirectories named 'CVS'. Is there a simple way to do this?

+9  A: 
tar -cpf - --exclude=CVS directory | sh -c 'cd /wherever/it/goes && tar -xpf -'

Modify the right-hand tar's options to -xvpf if you'd like to see what's going on.

chaos
Jukka Matilainen
A fine thought. :)
chaos
+7  A: 

Why not approach it from a slightly different angle and check out the files from CVS using the export command.

This'll give you the directories without any of the CVS artifacts.

Rob Wells
+6  A: 
rsync -av --exclude=CVS <src> <dst>
bromfiets