tar Directory Exclude
Posted on 1997-05-13
I'm writing a backup routine to .tar the contents of selected
directories. That's the easy part. Here's the problem.
I was to EXCLUDE the directory 'logs' from all the selected
directories to tar.
So say I tar recursively from my root directory using the "*"
wildcard. That would tar everything. But I want to exclude any
directories called 'logs', but sill tar recursively from the root.
Somebody suggested this so far, but it did't work, here's
my comments about it.
>find -type d -name logs -print > exclude_this
>tar cvXf exclude_this backup_filename *
I don't think this works. The first line does give
me a list of all the 'logs' directories. But the tar line doesn't seem
to work. As far as I can tell, tar doesn't have an 'exclude' option,
thus the file 'exclude_this' was ignored and everything was tar'ed
Any Ideas? Thanks!