On 8/1/05, Josh Welch <josh at joshwelch.com> wrote: 
> I've had lousy luck using the exclude option from the command line. I
> have had luck with creating a file containing a list of directories to
> exclude and using the exclude-from option. This works for me:
> 
> tar -cvf /backup/backup.tar / --exclude-from /backup/exclude.txt
> 
> exclude.txt looks like this:
> 
> /backup
> /dev
> /proc
> /sys
> 
> If you really wanted to make it a single script, you could do something
> that echos lines out to a file before running the tar command, kind of a
> hack but the best answer that I have.


Thanks, Josh.  I tried that with the -X option instead of typing out
the full --exclude-from, but it's still picking up the excluded
directories.  I'll give it a go with fully specifying the
--exclude-from option.


Karl Bongers wrote:
>Man page shows --exclude=PATTERN (with the equal sign).

Karl, I'm not sure what version of man pages you're looking at.  I'm
looking at the man pages on both Slackware 10.1 and RHELv3 systems
with the following specifications:

--exclude FILE
              exclude file FILE
-X, --exclude-from FILE
              exclude files listed in FILE

When I was googling for information on how I wanted the tar exclusions
to work, I did see what you're referencing.  However, in cross
comparison to the man pages it didn't match up.  I will admit that I
did give it a try, just in case, but it did not work correctly.

I was hoping to be able to use the exclude option instead of having to
specify which filesystems to backup.  Excluding seems like a more
simplistic path, as well as being able to restore more in a bare-metal
recovery procedure from tape instead of having to rely upon
incrementals to do so.

-- 
-Shawn

-Nemo me impune lacessit.  Ne Obliviscaris..