Hello tar community


I have some challenges using the *–directory *together with *--no-recursion*
option.
I’m using version 1.30 on Debian Stretch



The *--directory* option seem to be ignored, e.g.:

tar --directory="/tmp/fld 1/" --create --file="/tmp/fld 1/files.tar"
--exclude="files.tar" --no-recursion .

Archive is created in “/tmp/fld 1/” but it’s rather empty (have an empty ./
entry)

Tried to use different kind of wildcards but haven’t been successful.

I’m trying to create an archive without full-path information and no
recursion.



And one could also argue that using --file="files.tar" would save the
archive in the folder specified in the --directory option, but that’s not
the case, it’s located in “current” folder, in my case home.



If I try:

tar --directory="/tmp/fld 1/" --create --file="/tmp/fld 1/files.tar"
--exclude="files.tar" --no-recursion "/tmp/fld 1/”*

Archive is created in “/tmp/fld 1/” with expected content but it has
full-path information.


After reading the manual it was my expectation that the first example
should work:

-C, --directory=DIR

Change to DIR before performing *any* operations.  This option is
order-sensitive, i.e. it affects *all* options that follow.



*This is for ver. 1.29*

Best regards
Brian Wengel

Denmark

Reply via email to