3

If I have the following directory:

$ ls -a foo
.  ..  a  #a#  a~  b  b.bkp  c  .git  .hg  .svn

and call:

$ tar zcf foo-no-bkp.tar.gz --exclude-backups foo/

The resulting archive still has backup files (even those considered backup files according to the documentation).

$ tar ztf foo-no-bkp.tar.gz 
foo/
foo/a~
foo/.svn/
foo/#a#
foo/.hg/
foo/a
foo/.git/
foo/b.bkp
foo/c
foo/b

I am using GNU tar 1.26 on Ubuntu 12.04. What can be wrong? Should it be considered a bug?

  • Add a file called ~a and see whether it ignores that instead. – Alex Chamberlain Oct 2 '12 at 18:32
  • @Alex the ~a file is included, too. Anyway, I have just seen backup files with a tilde at the end for now... – brandizzi Oct 2 '12 at 19:04
8

I believe this is a bug which has been fixed, in July 2011, but probably hasn't made it to your version of tar yet.

v.1.26 is the current version, and was released 19 months ago (i.e. March 2011), but there will be some delay between the upstream patch and Ubuntu pushing out the fix. It looks like upstream haven't released this as a bug fix yet, since the latest 1.26 download is still dated March 2011.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.