I need to backup some data with the "p" option on tar command. The problem is the place I'm going to restore this data will have all the same users, but those users may have different IDs. Does that make any difference to tar or will it restore permissions correctly by user name?
|
Virtual everything (I want to say everything, but you can never be 100% sure) on UNIX uses the UID:GID values, because that's what is actually stored at the filesystem level. The name is just a simple lookup in the passwd file, the underlying checks are done using the numeric values. |
|||||||||
|
|
Summing up previous answers and adding some important information:
Hope this helps clarify the issue! :) |
|||
|
|
|
If you are trying to transfer files between two systems, rsync will by default set the permissions by username instead of uid, looking at the usernames at both ends. Only if the user doesn't exist on one of the systems will it copy it with the uid, unless you tell it otherwise. |
|||||
|
|
User the --same-owner option to GNU tar. See http://www.gnu.org/software/tar/manual/html_section/Attributes.html |
|||||||||
|