public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Walter Dnes" <waltdnes@waltdnes.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [OT] tar exclude syntax tip
Date: Wed, 5 May 2021 11:28:32 -0400	[thread overview]
Message-ID: <YJK5oG/tWNxEWuh+@waltdnes.org> (raw)
In-Reply-To: <20210505160303.58ba6a67@ventiloplattform.tastytea.de>

On Wed, May 05, 2021 at 04:03:03PM +0200, tastytea wrote
> 
> This works fine here with ???tar (GNU tar) 1.34???:
> 
> $ mkdir -p a/b
> $ touch a/file a/b/file
> $ touch a/file.xz a/b/file.xz
> $ tree a
> a
> ????????? b
> ???   ????????? file
> ???   ????????? file.xz
> ????????? file
> ????????? file.xz
> 
> 1 directory, 4 files
> $ tar -cvzf test.tar.gz --exclude="a/file" --exclude="a/b/*.xz" a

  That's files.  What happens with directories, e.g.
tar -cvzf test.tar.gz --exclude="a/b/" a

  I know I followed the manual.  Actually, my problem seems to be with
directories.  See
https://serverfault.com/questions/742514/running-the-tar-command-with-the-exclude-functionality-does-not-work-for-direc
where someone finds that...

tar hczf t.tar.gz * --exclude="./test1"

...doesn't work, but...

tar --exclude="./test1" -hczf t.tar.gz *

...does work!?!?!?

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


  parent reply	other threads:[~2021-05-05 15:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 13:33 [gentoo-user] [OT] tar exclude syntax tip Walter Dnes
2021-05-05 14:03 ` tastytea
2021-05-05 14:10   ` [gentoo-user] " Nuno Silva
2021-05-05 14:23     ` tastytea
2021-05-05 15:28   ` Walter Dnes [this message]
2021-05-05 16:00     ` [gentoo-user] " tastytea
2021-05-05 15:20 ` Grant Taylor
2021-05-06  0:07 ` Frank Steinmetzger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJK5oG/tWNxEWuh+@waltdnes.org \
    --to=waltdnes@waltdnes.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox