Hi Howard,

> When restoring files from a streamed archived (i.e. via the option -f
> -), it appears the parent subdirectories are restored with the user's
> ownership and umasked permissions (subject to any use of
> --no-overwrite-dir).

It does not depend on whether you use -f - or restore directly from the
archive.  The key part is using explicit member names in the command
line.  This instructs tar to extract only the listed members, and
nothing more.  In other words, when you do

  tar xf archive.tar etc/opt/wbem/cimserver_start.conf

tar extracts only etc/opt/wbem/cimserver_start.conf, *not* any of its
parent directories.  If any of its path components does not exist, tar
simply creates it, using current owner and umask settings.  In contrast,
when you do 

  tar xf archive.tar

then tar extracts all archive members, including directories, with their
proper ownerships and permission bits.

If you wish to restore directories as well, you'll need to specify them
explicitly, e.g.:

  tar -xf - --no-recursion etc/opt/wbem etc/opt/wbem/cimserver_start.conf

(notice the --no-recursion option).

Regards,
Sergey


Reply via email to