[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Understanding the -depth option of find?



On Wed, 07 Mar 2012 13:37:12 -0500, Randy Kramer wrote:

> On Wednesday 07 March 2012 12:51:48 pm Camaleón wrote:
>> On Wed, 07 Mar 2012 08:39:05 -0500, Randy Kramer wrote:
>> >      % find . -print -depth | cpio -ov > tree.cpio
> 
>> However, if you remember to use -depth, find will instead start its
>> search at the lowest level, meaning it will list the contents of
>> directories before it lists the directories themselves. This means that
>> the files will already have been replicated by cpio before it sets the
>> read-only permissions on the parent directory."
> 
> I guess that implies I'd better do something about the permissions on
> that read-only subdirectory before the next (and each) time I run that
> find...cpio command.

Nothing you should care about when using the mentioned parameter (-depth).

Anyway, I make the backup for my /home directory with plain "tar". What 
are the benefits/drawbacks of using "cpio" instead? I remember an ancient 
discussion about this and IIRC, cpio could perform crc checksums but it 
also had its cons.

Greetings,

-- 
Camaleón


Reply to: