[nflug] copy (cp) large number of files
Ken Smith
kensmith at cse.Buffalo.EDU
Tue Apr 25 10:52:16 EDT 2006
On Tue, 2006-04-25 at 10:43 -0400, Jason Lasker wrote:
> I ran into this problem too and used a tar pipe to copy files...
>
> tar -cf - directory | (cd parent; tar -xf -)
>
> Check you tar options for the proper switches/parameters
>
I usually use "-xpBf" on the tar doing the extracting (second one). The
"p" means preserve everything possible (owner/group/perms/timestamps)
and the "B" locks the blocking factor at something sane for a pipe (tar
still thinks it's talking to a tape drive by default and if for some
reason the first read is a bit short it can decide to use a small block
size which makes it pretty inefficient).
And for those of you with multiple machines and data that needs to move
amongst them this can work as well:
tar -cf - directory | ssh target-machine "(cd parent; tar -xpBf -)"
:-)
--
Ken Smith
- From there to here, from here to | kensmith at cse.buffalo.edu
there, funny things are everywhere. |
- Theodore Geisel |
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug
More information about the nflug
mailing list