Subject: [svlug]Re: how to copy a bunch of "." files?
From: Bryan -TheBS- Smith <[email-masked]>
To: [email-masked]
Date: Thu, 27 Apr 2000 11:04:01 -0400

On Thu, 27 Apr 2000, Ian B MacLure wrote:
> To copy the entire directory hierarchy below your PWD
> cd to the directory you want to copy FROM
> 
> find . -print | cpio -dmpv <TO-DIRECTORY-PATH>

Learn this by heart and you will be a successful UNIX admin.
Copiest everything exact, all files, all permissions.

Date: Thu, 27 Apr 2000 13:32:47 -0400 (EDT)
Reply-To: Francis Pinteric <[email-masked]>
From: Francis Pinteric <[email-masked]>
To: Ian B MacLure <[email-masked]>
Cc: [email-masked], Daevid Vincent <[email-masked]>
Subject: [svlug] Re: [svlug]how to copy a bunch of "." files?

On 27-Apr-2000 Ian B MacLure wrote:

>       To copy the entire directory hierarchy below your PWD
>       cd to the directory you want to copy FROM
> 
>       find . -print | cpio -dmpv <TO-DIRECTORY-PATH>
> 

And here's another example. This can be simply

 find . -exec cp -av {} <TO-DIRECTORY-PATH> \;

Date: Fri, 28 Apr 2000 17:50:19 -0700
From: Seth David Schoen <[email-masked]>
To: [email-masked]
Subject: Re: [svlug] Re: [svlug]Re: how to copy a bunch of "." files?

Marc Merlin writes:

> On jeu, avr 27, 2000 at 11:04:01 -0400, Bryan -TheBS- Smith wrote:
>> On Thu, 27 Apr 2000, Ian B MacLure wrote: 
>>> To copy the entire directory hierarchy below your PWD
>>> cd to the directory you want to copy FROM
>>> 
>>> find . -print | cpio -dmpv <TO-DIRECTORY-PATH>
>> 
>> Learn this by heart and you will be a successful UNIX admin. 
>> Copiest everything exact, all files, all permissions.
> 
> Why bother?
> cp -a source dest
> 
> It's just like the tar cf - | (cd dest; tar xvf -), it's really
> useless when
> you have GNU cp.

That was useful before rsync when you put an ssh in there:

(sleep 10; tar cf -) | ssh somewhere 'cd /here; tar xvf -'

Actually, I'm sure rsync had been released by the time I learned that
ssh pipe stuff, but it takes a while for the file-copying tricks to
synchronize over the network. :-)

Date: Thu, 27 Apr 2000 09:06:48 -0700
From: Seth David Schoen <[email-masked]>
To: [email-masked]
Subject: [svlug] Re: [svlug]Re: how to copy a bunch of "." files?

Well, you could also

rsync -var . <dest>

nowadays.  rsync went and obsoleted a lot of beautiful pipe-tricks and
archive software. :-(

If rsync -a doesn't preserve enough file attributes for you, there are
moreoptions to preserve other things.

The cool thing about this is that, if you do it again later, it will
only need to copy the differences between the files.

Try it, you'll like it.

Date: Thu, 27 Apr 2000 13:30:26 -0400 (EDT)
From: Francis Pinteric <[email-masked]>
To: Ian B MacLure <[email-masked]>
Cc: [email-masked], Drew Bloechl <[email-masked]>
Subject: [svlug] Re: [svlug]how to copy a bunch of "." files?

Here's a question that I seen a lot of and I' wondering what the
advantage is.

When using find, I see a lot of people using xargs when most of the time it
isn't necessary. For example, the above find sequence can be written as:

  find . -type f -maxdepth 1 -exec mv {} otherdir \;

What advantage does xargs provides in cases like this? Just wondering.

Date: Wed, 3 May 2000 20:20:45 +0200 (CET)
From: Jean-Marc Libs <[email-masked]>
To: Francis Pinteric <[email-masked]>
cc: [email-masked]
Subject: Re: [svlug] Re: [svlug]how to copy a bunch of "." files?

Speed through parallelism, usually.
Try it in a full directory (a newsspool comes to mind :-) )

Obviously, in this specific case, -maxdepth 1 severely restricts
the usefulness of the trick, hence the silly example.