[WBEL-users] Disc cloning

Andy Rabagliati andyr at wizzy.com
Wed Mar 9 00:57:48 CST 2005


On Tue, 08 Mar 2005, Kirby C. Bohling wrote:

> On Tue, Mar 08, 2005 at 02:51:58PM -0600, Dan wrote:
> > 
> > cd /tmp/orig
> > find . -print | cpio -pmd /tmp/dest
> > 
> 
> Hmmm, how does cpio handle things with spaces newlines or other
> nasties in the file name (carriage returns among other things).  I
> copy filesystems that I don't get any control over the file names,
> so out of habit, I distrust anything that uses "find ... -print" and
> passes that as input to another command.
> 
> This: find ... -exec [command] {} \; 
> Over: find ... -print | xargs [command]

Notice there is no 'xargs' in Dan's solution.

> If you have any concerns about file names, I'd use this version:
> 
> find . -print0 | cpio -pmd --null /tmp/dest

But does cpio handle null-separated filenames ?

xargs has the -0 switch - cpio would need the same.

> Thanks for the reply.  I always end up reading on cpio anytime I
> unpack Oracle Server distributions, other then that I am just
> blissfully ignorant.  I now understand why "pass-thru exists".  I
> never understood it before.

I would trust cpio talking to cpio before trusting find talking to cpio.

Cheers,     Andy!


More information about the Whitebox-users mailing list