Exclude directory in recursive copy

How can I (easily) exclude a directory ("CVS") from a recursive copy?

The executed command is:
cp -vur sourcedirectory .

Best regards,
Kenneth
Kenneth Brun Nielsen [ Di, 13 November 2007 14:32 ] [ ID #1869019 ]

Re: Exclude directory in recursive copy

On Tue, 13 Nov 2007 13:32:52 -0000, Kenneth Brun Nielsen
<kenneth.brun.nielsen [at] googlemail.com> wrote:

>How can I (easily) exclude a directory ("CVS") from a recursive copy?
>
>The executed command is:
>cp -vur sourcedirectory .
>
>Best regards,
>Kenneth

Can you use rsync? Something like

rsync -av --exclude=CVS source_dir dest_dir


Scott McMillan
Scott McMillan [ Di, 13 November 2007 15:12 ] [ ID #1869021 ]

Re: Exclude directory in recursive copy

Le Tue, 13 Nov 2007 13:32:52 +0000, Kenneth Brun Nielsen a écrit :

> How can I (easily) exclude a directory ("CVS") from a recursive copy?
>
> The executed command is:
> cp -vur sourcedirectory .
>
> Best regards,
> Kenneth

this should work :

find source/ -type f -exec cp {} . \;

bodman
bodman [ Di, 13 November 2007 16:31 ] [ ID #1869023 ]

Re: Exclude directory in recursive copy

On 2007-11-13, bodman <bodman [at] wanadoo.fr> wrote:
> Le Tue, 13 Nov 2007 13:32:52 +0000, Kenneth Brun Nielsen a écrit :
>
>> How can I (easily) exclude a directory ("CVS") from a recursive copy?
>>
>> The executed command is:
>> cp -vur sourcedirectory .
>>
>> Best regards,
>> Kenneth
>
> this should work :
>
> find source/ -type f -exec cp {} . \;
>
That would copy all the files into one directory, and wouldn't exclude
any files.
Bill Marcum [ Di, 13 November 2007 21:06 ] [ ID #1869035 ]

Re: Exclude directory in recursive copy

Le Tue, 13 Nov 2007 15:06:47 -0500, Bill Marcum a écrit :

> On 2007-11-13, bodman <bodman [at] wanadoo.fr> wrote:
>> Le Tue, 13 Nov 2007 13:32:52 +0000, Kenneth Brun Nielsen a écrit :
>>
>>> How can I (easily) exclude a directory ("CVS") from a recursive copy?
>>>
>>> The executed command is:
>>> cp -vur sourcedirectory .
>>>
>>> Best regards,
>>> Kenneth
>>
>> this should work :
>>
>> find source/ -type f -exec cp {} . \;
>>
> That would copy all the files into one directory, and wouldn't exclude
> any files.

right, bad reading :)
bodman [ Mi, 14 November 2007 05:37 ] [ ID #1869956 ]
Linux » comp.unix.shell » Exclude directory in recursive copy

Vorheriges Thema: in awk or shell we trust
Nächstes Thema: oppsite of paste