Bob McGowan schreef:
> Sjoerd Hardeman wrote:
>> Stephen Powell schreef:
>>> Hi, all!
>>>
>>> In one of my web pages, as part of a larger overall procedure, I give
>>> instructions for copying an entire partition.  The basic procedure involves
>>> mounting one partition on /media and the other on /mnt.
>>>
>>> ...
>>> ...
>>
>> rsync -a /media/ /mnt/
>> OR
>> find /media -exec cp -a {} /mnt \;
> 
> I'm not sure this second one will work as expected, unless you remove
> the '-a' on the 'cp'.
> 
> The 'find' is recursive and so is 'cp -a', so every directory found by
> 'find' will be recursively processed by both.  'cp' will end up copying
> files multiple times, depending on the directory depth.
> 
> Though the result may be OK (copies over copies), the amount of work and
> length of time to complete will both be unnecessarily large.
Good point, I forgot that cp -a is recursive. Although I always use
rsync in cases like this, which is a lot easier.

Sjoerd

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to