Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Oct 2003 15:25:27 -0700
From:      Pat Lashley <patl+freebsd@volant.org>
To:        Chuck Swiger <cswiger@mac.com>, Jamie <jamie@gnulife.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: tar vs cp
Message-ID:  <2156421632.1065047127@mccaffrey.phoenix.volant.org>
In-Reply-To: <3F7B0D5C.7080009@mac.com>
References:  <20031001122603.B71418-100000@floyd.gnulife.org> <3F7B0D5C.7080009@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--On Wednesday, October 01, 2003 13:22:36 -0400 Chuck Swiger 
<cswiger@mac.com> wrote:

> Jamie wrote:
> [ ... ]
>>     I don't know what the actual rationale is for this. Can anyone
>>     explain why it is oftentimes better to tar something rather than
>> using cp when copying directories and their contents?
>
> tar handles symbolic links properly, whereas cp will "copy through" the
> contents of the link.

Another technique is 'cd /source ; find . -print | cpio -pdmv /dest'.

But none of the built in tools seem to preserve links, flags, and
sparseness.  If you want as close to a true copy as possible, check
out the cpdup port.



-Pat



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2156421632.1065047127>