Re: excluding files w/ tar
On Wed, Jun 01, 2005 at 11:00:18AM -0700, Cameron Matheson wrote:
> Hi everyone,
> i'm trying to back up an old suse box so that i can
> clear it off and install debian. anyway, i want to
> tar up basically everything (except for the obvious
> stuff like proc, /tmp/, /dev, etc.) so i've made an
> excludes file:
> $ cat /tmp/excludes
> then i'm using this command to tar it up:
> $ tar cv -X /tmp/excludes -p --atime-preserve * -- |
> netcat 10.1.22.39 80
> but all the directories in my excludes file are still
> being backed up! where am i going wrong?
I think the match is done against the file as it named by tar, which,
in the absence of this option of tar:
don't strip leading `/'s from file names
would be, for example, "./tmp/", not "/tmp/".
Try putting ./tmp/* instead of /tmp/* and so on in /tmp/excludes, or, if you
never make mistakes, use -P (dangerous when extracting).