bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] Possible bug in directory exclusion in GNU Tar 1.26


From: Dotan Cohen
Subject: [Bug-tar] Possible bug in directory exclusion in GNU Tar 1.26
Date: Sun, 7 Apr 2013 09:46:03 +0300

When excluding directories to be tarred with GNU Tar, a slash after
the directory name makes the exclude fail:

$ mkdir a
$ mkdir a/bigfiles
$ mkdir b
$ echo 12345 > a/1.txt
$ echo 67890 > a/2.txt
$ echo nice > a/3.txt
$ echo "This is a big file\!" > a/bigfiles/big.txt
$ tar -czf backup.tgz a/ --exclude a/bigfiles/
$ mv backup.tgz b
$ cd b/
$ tar -xzf backup.tgz
$ tree a/
a/
├── 1.txt
├── 2.txt
├── 3.txt
└── bigfiles
    └── big.txt

The same test but without the trailing slash on "a/bigfiles" properly
excludes the bigfiles directory. In my opinion this is a bug as it is
in contrast to other GNU tools such as cp which do accept a trailing
slash. Furthermore, Bash filename completion adds the trailing slash
so it is intuitive that the command will include it.

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



reply via email to

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