RE: tar question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please look at the tar line closer:

Um...right. My bad. Comes from doing two things at a time.

My version of tar is 1.13.25, plus I'm also using the '=' in my exclude.
It is possible that they changed how exclude works in the newer version
of tar.

Nah, I don't think so. The difference comes from the fact that
you use a a relative path to state the stuff to include, whereas I use
an absolute path. Let's make this definitive statement and call it
quits for today as the beer awaits. Apparently "exclude" does not
100% respect the principle of least astonishment:


cd /

# CASE 1:

tar -zcf out1.tgz --exclude=etc/sysconfig   etc
-> the archive contains relative paths
-> etc/sysconfig has been excluded
  (parameter matches archive path)

# CASE 2:

tar -zcf out2.tgz --exclude=/etc/sysconfig  etc
-> the archive contains relative paths
-> etc/sysconfig has NOT been excluded!
  (parameter does not match archive path)

# CASE 3:

tar -zcf out3.tgz --exclude=etc/sysconfig   /etc
-> the archive contains relative paths, as the leading '/' is stripped
  tar says "Removing leading `/' from member names"
  (a Good Thing as you can then untar anywhere)
-> etc/sysconfig has been excluded
  (parameter matches archive path)

# CASE 4:

tar -zcf out4.tgz --exclude=/etc/sysconfig  /etc
-> the archive contains relative paths, as the leading '/' is stripped
  tar says "Removing leading `/' from member names"
  (a Good Thing as you can then untar anywhere)
-> etc/sysconfig HAS BEEN excluded
  (even though parameter does not match archive path)



--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux