From owner-freebsd-questions Mon May 20 7:18:41 2002 Delivered-To: freebsd-questions@freebsd.org Received: from empty1.ekahuna.com (empty1.ekahuna.com [198.144.200.196]) by hub.freebsd.org (Postfix) with ESMTP id CF62937B404 for ; Mon, 20 May 2002 07:18:34 -0700 (PDT) Received: from pc-02 (pc02.ekahuna.com [198.144.200.197]) by empty1.ekahuna.com (Post.Office MTA v3.5.3 release 223 ID# 0-0U10L2S100V35) with ESMTP id com; Mon, 20 May 2002 07:18:34 -0700 From: "Philip J. Koenig" Organization: The Electric Kahuna Organization To: questions@FreeBSD.ORG Date: Mon, 20 May 2002 07:18:35 -0700 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: More tar problems Reply-To: pjklist@ekahuna.com Cc: Dru References: <20020520050250032.AAA423@empty1.ekahuna.com@pc02.ekahuna.com> In-reply-to: <20020520094005.J54198-100000@cogeco.ca> X-mailer: Pegasus Mail for Win32 (v3.12c) Message-ID: <20020520141834152.AAA428@empty1.ekahuna.com@pc02.ekahuna.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 20 May 2002, at 9:49, Dru boldly uttered: > On Sun, 19 May 2002, Philip J. Koenig wrote: > > > It seems like some aspects of tar have changed since earlier 4.x > > FreeBSD. I used to use the following command to facilitate copying > > filesystems from an old hard disk to a new one, but it no longer > > works on 4.6-PRE: > > > > tar clf - -C /start_dir -X /excluded_dir -X /another_excluded_dir . | tar xpvf - -C /destination_dir > > > > ("dir" also means "filesystem") > > > > Problem seems to be it ignores the "-X" option. I get this kind of > > result: > > > > tar: can't add file -X : No such file or directory > > tar: Removing leading / from absolute path names in the archive. > > > > > > So it seems it ignores the -X option and then tries to add the > > argument to the -X option to the archive. I also tried "--exclude- > > from" instead of -X, same result. > > > Hi Philip, > > Have you tried echoing the names of the excluded files/directories/file > systems to a file and telling -X about that file? For example, this works for > me on 4.5: > > echo /usr > exclude > > tar czvfX backup.tar exclude / Hm, I thought "-exclude" did something different than "-X" or "--exclude-from"? Reading the manpage, "exclude" implies it's a specific pattern, whereas the -X option used to easily exclude anything falling under the directory specified. (can someone just clarify when tar changed.. because I'm *positive* I used that -X option previously, and it wasn't an "exclude files listed in 'file' function either) (FWIW, I originally picked up this technique from the guy who put together www.mostgraveconcern.com/freebsd, but the site appears to be down at the moment) Now in looking through some of the archives for answers, Mike Meyer posted a response to someone a couple months back that using tar to backup filesystems isn't such a great idea because it doesn't preserve file flags. Since I ended up having to backup/restore to/from tape using dump/restore, I did my share of manpage reading for those utilities last night. Is there any reason I couldn't use dump in the same way - ie pointing dump at filesystem A, sending the output to std-out, piping it to restore pointing at filesystem B? Would that solve the flag problem? Better yet, is there an easy way to exclude directories? Thx, Phil -- Philip J. Koenig pjklist@ekahuna.com Electric Kahuna Systems -- Computers & Communications for the New Millenium To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message