Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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