Date: Mon, 20 May 2002 07:18:35 -0700 From: "Philip J. Koenig" <pjklist@ekahuna.com> To: questions@FreeBSD.ORG Cc: Dru <dlavigne6@cogeco.ca> Subject: Re: More tar problems Message-ID: <20020520141834152.AAA428@empty1.ekahuna.com@pc02.ekahuna.com> In-Reply-To: <20020520094005.J54198-100000@cogeco.ca> References: <20020520050250032.AAA423@empty1.ekahuna.com@pc02.ekahuna.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020520141834152.AAA428>
