[lxc-devel] [PATCH 2/2] templates: use hardlink detection in rsync

Michael H. Warfield mhw at WittsEnd.com
Mon Dec 3 19:31:24 UTC 2012


On Mon, 2012-12-03 at 14:10 -0500, Dwight Engen wrote:
> On Mon, 03 Dec 2012 13:55:41 -0500
> "Michael H. Warfield" <mhw at WittsEnd.com> wrote:
> 
> > On Mon, 2012-12-03 at 12:18 -0600, Serge Hallyn wrote:
> > > Quoting Dwight Engen (dwight.engen at oracle.com):
> > > > On Mon, 3 Dec 2012 10:47:26 -0600
> > > > Serge Hallyn <serge.hallyn at canonical.com> wrote:
> > > > 
> > > > > Quoting Dwight Engen (dwight.engen at oracle.com):
> > > > > > On Mon, 3 Dec 2012 10:04:13 -0600
> > > > > > Serge Hallyn <serge.hallyn at canonical.com> wrote:
> > > > > > 
> > > > > > > However one question is:  is -H ubiquitous?
> > > > > > 
> > > > > > I'm wondering why we don't just use the cp -a? It seems like
> > > > > > cp is far more likely to be installed than rsync? rootfs_path
> > > > > > probably doesn't already exist so it not like rsync is going
> > > > > > to be faster?

> One reason I commented on this was that I had noticed the use of rsync
> to do this copy in other places as well, namely just about every
> template that caches a rootfs, so we might want to consider replacing
> those as well. Note that I'm not an rsync hater at all :) its a great
> tool and I use it all the time for cross machine mirroring, backups
> etc.. but if all we're doing is local file system directory copies, I
> think there are benefits to reducing our external tool dependencies.

I think the reason for this is historical and portability more than any
thing else (neither of which are really applicable to this project).  If
you go to AIX or HP/UX or Solaris, the stock "cp" is just not going to
support -a or -T.  I'm not sure about the current lines of
{Free,Open,Net}BSD.  So, ultimately, rsync just became the defacto
standard for doing these sorts of things like cpio use to be back in the
dark ages for some of us old fossils.  :-)  I'm not even sure when or
where the "-a" option was introduced to cp but it was a long time before
I even became aware of it.  It's always good to learn something new here
though!  :-)=)

Thanks!

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20121203/41df2f91/attachment.pgp>


More information about the lxc-devel mailing list