Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
I dont think that is part of cp.
A look at rsync performance
Posted Aug 19, 2010 10:48 UTC (Thu) by spaetz (subscriber, #32870)
but perhaps that is missing out things that tar manages to preserve. Not sure. Just curious in any case.
Posted Aug 19, 2010 15:08 UTC (Thu) by bronson (subscriber, #4806)
Nowadays cp -a works well everywhere (in my experience) so there's no need to resort to tar. It's just damage from the Unix wars.
Posted Aug 19, 2010 19:31 UTC (Thu) by pj (subscriber, #4506)
tar cf - . | ssh user@remote "cd /dest/dir; tar xf -)
(ssh user@remote "cd /src/dir ; tar cf - . ") | (cd /dest/dir; tar xf -)
Posted Aug 20, 2010 11:53 UTC (Fri) by NAR (subscriber, #1313)
Posted Aug 20, 2010 12:28 UTC (Fri) by dsommers (subscriber, #55274)
Posted Aug 20, 2010 14:52 UTC (Fri) by spaetz (subscriber, #32870)
Only because you open a new ssh connection per file by default and tar+ssh opens only one. Which causes lots of overhead. If you reuse your ssh connection scp will be fast as well:
Posted Aug 21, 2010 2:05 UTC (Sat) by dmag (subscriber, #17775)
Posted Aug 24, 2010 20:01 UTC (Tue) by BackSeat (subscriber, #1886)
tar -C /src/dir -cf - . | tar -C /dest/dir -xf -
Posted Aug 19, 2010 21:08 UTC (Thu) by evgeny (guest, #774)
Posted Aug 25, 2010 3:09 UTC (Wed) by roelofs (guest, #2599)
BSDs included? In my experience they've been mighty picky about the GNUisms (or "things that would have been GNUisms if someone else hadn't done them first") they're willing to implement. I remember being surprised by something along those lines just a couple of months ago, though I've forgotten the details already.
But perhaps cp -a came from BSD in the first place...
Posted Aug 25, 2010 13:25 UTC (Wed) by dmarti (subscriber, #11625)
Posted Aug 19, 2010 10:50 UTC (Thu) by valhalla (subscriber, #56634)
Posted Aug 19, 2010 10:56 UTC (Thu) by dafid_b (guest, #67424)
I would use the tar pipe of old as I expect it to build a proper copy in the new location.
Having read the cp manual page again (and again) I fear my confidence in tar might be misplaced :(.
Anyone know of a tutorial for each of the cp options?
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds