From owner-freebsd-questions@FreeBSD.ORG Thu May 11 02:02:33 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A78416A400 for ; Thu, 11 May 2006 02:02:33 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2590C43D46 for ; Thu, 11 May 2006 02:02:33 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [192.168.2.2] ([69.27.149.254]) by ezekiel.daleco.biz (8.13.4/8.13.1) with ESMTP id k4B22V61048537; Wed, 10 May 2006 21:02:31 -0500 (CDT) (envelope-from kdk@daleco.biz) Message-ID: <44629B31.1090006@daleco.biz> Date: Wed, 10 May 2006 21:02:25 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.2) Gecko/20060509 SeaMonkey/1.0.1 MIME-Version: 1.0 To: "Don O'Neil" References: <007601c6749a$28057630$0300020a@mickey> In-Reply-To: <007601c6749a$28057630$0300020a@mickey> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: 'Andy Greenwood' , freebsd-questions@freebsd.org Subject: Re: Copying a file system w/ tar - symbolic links not copied right. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2006 02:02:33 -0000 > On 5/10/06, Don O'Neil wrote: >> >> tar cf - /source/* | ( cd /destination && tar xfv - ) >> >> It copies all the files, but the symbolic links are copied as files of >> 0 length, rather than re-established as links. >> >> What am I doing wrong here, or is my tar broken? > From: Andy Greenwood [mailto:greenwood.andy@gmail.com] > Sent: Wednesday, May 10, 2006 6:24 PM > To: Don O'Neil > > # man tar > > specifically, the -L option Don O'Neil wrote: > My man says: > > -L number > --tape-length number Change tapes after writing number * 1024 bytes. > > Nothing about symbolic links.... Now there is an option --unlink-first and > --dereference... Both of which don't copy the links, but unlink or copy the > actual source file. > > Don > > And again: >> What am I doing wrong here, or is my tar broken? Heh, heh, could be. Andy is referring to "BSDtar", which is tar(1) on later releases, and your -L option is from "GNUtar", which is tar(1) on, IIRC, 4.X and elder, and is now available in ports as gtar. As for what's really the problem, I can't say as I can tell. On my 6.X box, everything works as expected. For fun, I shelled into a 4.11 box, and everything works as expected, both my tests and your example. Maybe your tar *is* broken. Or, more likely, we're both a tad dense ATM. Kevin Kinsey -- What foods these morsels be!