On 26/05/16 09:05, Sergey Poznyakoff wrote:
Hi Ben,
The --exclude option is position-sensitive, which means it applies to
any arguments or options appearing after it in the command line.
Therefore the correct tar invocation is:
   tar zcvvfXT - excludes includes
Please see 3.4.4 "Position-Sensitive Options"[1], for details.
Regards,
Sergey
[1] http://www.gnu.org/software/tar/manual/html_section/tar_22.html

Thanks very much Sergey. I can confirm that changing the order of the excludes and includes, as you indicated above, gives me the desired behaviour with tar 1.29:

$ tar zcvvfXT - excludes includes > /dev/null
drwxrwx--- ben/ben           0 2016-05-21 14:39 base/
drwxrwx--- ben/ben           0 2016-05-21 14:40 base/dir-1/
-rw-rw---- ben/ben           0 2016-05-21 14:40 base/dir-1/file-1

Kind regards,

--
Ben Caradoc-Davies <[email protected]>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

Reply via email to