[Help-tar] --exclude partially working with --format=posix ?
From:
Matthew Peterson
Subject:
[Help-tar] --exclude partially working with --format=posix ?
Date:
Tue, 22 Jun 2010 14:09:10 -0700
Hello,
I'm seeing unusual behavior creating archives using --format=posix and then attempting to extract them using the --exclude option. The --exclude option appears to work for files in the first several sub-directories, but not for sub-directories further down (~100 characters in), e.g.
# Versions cat /etc/redhat-release CentOS release 5 (Final) /usr/local/bin/tar --version|grep tar tar (GNU tar) 1.23
# BEGIN SCRIPT
#!/bin/bash # Create directory to tar with 'txt' and 'doc' files
mkdir -p /tmp/one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen
cd /tmp/one touch 1.doc 1.txt cd
/tmp/one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen touch 15.doc 15.txt
cd
/tmp/one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen touch
16.doc 16.txt
# Create archive /usr/local/bin/tar -C /tmp/ --format=posix --create --file=/tmp/one.tar one
I have tried the above script using --format=gnu instead of --format=posix and it appears to work correctly (e.g. The output of directory 'sixteen' shows only the file '16.doc' and correctly excludes '16.txt')