[plug] IDE-Tape Drive - Solved
Ryan
ryan at is.as.geeky.as
Tue Sep 23 01:19:51 WST 2003
On Mon, 2003-09-22 at 22:20, Andrew Furey wrote:
> > > I then began to use tar, but of course if you want
> > > to exclude files or directories, it doesn't
> actually
> > > work in any way.
>
> I don't know if it's any help, but I've never gotten
> the --exclude= option to work either. However, last I
> remember (which was a few months ago), --exclude-from=
> (-X) _did_ work.
WARNING: tar amateur at work below ....
I've never had a problem with --exclude=
I'm using it under the assumption that it runs the match on the _ENTIRE
RELATIVE FILENAME_ starting from the beginning, so if we were in a
directory such as /usr/local on my system it has in it:
drwxr-sr-x 6 root staff 4096 Sep 15 2002 Acrobat5
drwxr-sr-x 6 root staff 4096 Sep 10 21:46 RealPlayer8
drwxr-sr-x 3 root staff 4096 Dec 18 2002 RealPlayer9
drwxr-sr-x 3 root staff 4096 Jan 7 2003 ircd
drwxr-sr-x 3 root staff 4096 Sep 4 2002 kylix2
drwxr-sr-x 12 root staff 4096 Sep 4 2002 kylix3
drwxr-sr-x 9 root staff 4096 Feb 11 2003 mozilla
drwxrwsr-x 2 root staff 4096 Jun 13 2001 sbin
drwxrwsr-x 10 root staff 4096 Jun 26 18:48 share
If I was to do:
tar zcvf /tmp/archive.tgz .
It shows the files like this:
./
./share/
./share/games/
./share/games/fortunes/
So to exclude the share directory for example:
tar zcvf /tmp/archive.tgz --exclude=./share .
If however I did this:
tar zcvf /tmp/archive.tgz *
It shows files like this:
share/
share/games/
share/games/fortunes/
So you exclude the share directory like so:
tar zcvf /tmp/archive.tgz --exclude=share *
Once we've cleared that common mistake up, you can do stuff like this,
so long as the match takes into account the whole filename placeholding
at the start:
--exclude=*/games/*unes
That would take out share/games/fortunes/ from above listing
If you want to match a directory and thus wipe out everything below it,
you must not put a slash after its name at the end of the pattern
(*/games not */games/)
For filenames, you can do whatever you like.
tar on one SCO system at work has no exclude options, so I list the
files needed and grep out the ones i want to exclude and pass that list
to tar.
If anyone else has anything to add/delete from that - feel free, I feel
I'm in need of guidance on this as much as anyone else :)
Ryan
_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
More information about the plug
mailing list