From owner-freebsd-questions Mon May 20 6:47:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from fep3.cogeco.net (smtp.cogeco.net [216.221.81.25]) by hub.freebsd.org (Postfix) with ESMTP id 33D1137B400 for ; Mon, 20 May 2002 06:47:13 -0700 (PDT) Received: from d226-33-213.home.cgocable.net (d226-33-213.home.cgocable.net [24.226.33.213]) by fep3.cogeco.net (Postfix) with ESMTP id 2FEA4252B; Mon, 20 May 2002 09:47:12 -0400 (EDT) Date: Mon, 20 May 2002 09:49:54 -0400 (EDT) From: Dru To: "Philip J. Koenig" Cc: questions@FreeBSD.ORG Subject: Re: More tar problems In-Reply-To: <20020520050250032.AAA423@empty1.ekahuna.com@pc02.ekahuna.com> Message-ID: <20020520094005.J54198-100000@cogeco.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 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 / HTH, Dru To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message