| www.delorie.com/gnu/docs/tar/tar_119.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
(This message will disappear, once this node revised.)
When tar reads files, this causes them to have the access times
updated. To have tar attempt to set the access times back to
what they were before they were read, use the --atime-preserve
option. This doesn't work for files that you don't own, unless
you're root, and it doesn't interact with incremental dumps nicely
(see section 5. Performing Backups and Restoring Files), but it is good enough for some purposes.
Handling of file attributes
When this option is used, tar leaves the modification times
of the files it extracts as the time when the files were extracted,
instead of setting it to the time recorded in the archive.
This option is meaningless with --list (-t).
When using super-user at extraction time, ownership is always restored.
So, this option is meaningful only for non-root users, when tar
is executed on those systems able to give files away. This is
considered as a security flaw by many people, at least because it
makes quite difficult to correctly account users for the disk space
they occupy. Also, the suid or sgid attributes of
files are easily and silently lost when files are given away.
When writing an archive, tar writes the user id and user name
separately. If it can't find a user name (because the user id is not
in `/etc/passwd'), then it does not write one. When restoring,
and doing a chmod like when you use --same-permissions (--preserve-permissions, -p)
(@quote-arg
), it tries to look the name (if one was written)
up in `/etc/passwd'. If it fails, then it uses the user id
stored in the archive instead.
This is useful in certain circumstances, when restoring a backup from an emergency floppy with different passwd/group files for example. It is otherwise impossible to extract files with the right ownerships if the password file in use during the extraction does not match the one belonging to the filesystem(s) being extracted. This occurs, for example, if you are restoring your files after a major crash and had booted from an emergency floppy with no password file or put your disk into another machine to do the restore.
The numeric ids are always saved into tar archives.
The identifying names are added at create time when provided by the
system, unless --old-archive (-o) is used. Numeric ids could be
used when moving archives between a collection of machines using
a centralized management for attribution of numeric ids to users
and groups. This is often made through using the NIS capabilities.
When making a tar file for distribution to other sites, it
is sometimes cleaner to use a single owner for all files in the
distribution, and nicer to specify the write permission bits of the
files as stored in the archive independently of their actual value on
the file system. The way to prepare a clean distribution is usually
to have some Makefile rule creating a directory, copying all needed
files in that directory, then setting ownership and permissions as
wanted (there are a lot of possible schemes), and only then making a
tar archive out of this directory, before cleaning everything
out. Of course, we could add a lot of options to GNU tar for
fine tuning permissions and ownership. This is not the good way,
I think. GNU tar is already crowded with options and moreover,
the approach just explained gives you a great deal of control already.
This option causes tar to set the modes (access permissions) of
extracted files exactly as recorded in the archive. If this option
is not used, the current umask setting limits the permissions
on extracted files.
This option is meaningless with --list (-t).
The --preserve option has no equivalent short option name. It is equivalent to --same-permissions (--preserve-permissions, -p) plus --same-order (--preserve-order, -s).
@quote-arg
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |