bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can --exclude patterns contain /-characters?


From: Mikko Saukkoriipi
Subject: Can --exclude patterns contain /-characters?
Date: Sat, 1 Mar 2003 22:20:36 +0200

I'm trying to use tar for backupping my files, but I've run in to problems
with --exclude. I would like to exclude certain directories with their
subdirectories and _only_ those directories, not some other directory
somewhere else in the filesystem. I think the best way to accomplish this
would be to give the whole path of the directory to exclude as the exclude
pattern. But as soon as the exclude-pattern has a single /-character it
loses it's effect.


Examples. All the examples are run in the "/home/edonkey/backuptesti"
directory trying to backup the "/home/edonkey/backuptesti/home/edonkey"
directory.

# This command works, but it will also exclude any files or directories
named "mldonkey"
tar cvf temp.tar --totals --exclude=mldonkey home/edonkey/

# None of the following patterns work.
tar cvf temp.tar --totals --exclude=mldonkey/ home/edonkey/
tar cvf temp.tar --totals --exclude='mldonkey/' home/edonkey/
tar cvf temp.tar --totals --exclude='mldonkey/*' home/edonkey/
tar cvf temp.tar --totals --exclude='/mldonkey' home/edonkey/
tar cvf temp.tar --totals --exclude='*/mldonkey' home/edonkey/
tar cvf
temp.tar --totals --exclude=/home/edonkey/backuptesti/home/edonkey/mldonkey
home/edonkey/
tar cvf
temp.tar --totals --exclude=home/edonkey/backuptesti/home/edonkey/mldonkey
home/edonkey/

# This is similar to the example given in the GNU Tar manual
http://www.gnu.org/manual/tar/html_chapter/tar_6.html#SEC91 , but doens't
work either (the latter even gives error, error in the manual -X is used
with exclude file, when giving patterns it should use --exclude)
tar cvf temp.tar --totals --exclude='*/mldonkey/*' home/edonkey/
tar cvf temp.tar --totals -X '*/mldonkey/*' home/edonkey/

I would consider the exclude option broken.


Mikko Saukkoriipi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]