Operating System - HP-UX
1834818 Members
2957 Online
110070 Solutions
New Discussion

Re: How to keep the user/owner permission for fbackup/tar/rcp

 
SOLVED
Go to solution
j773303
Super Advisor

How to keep the user/owner permission for fbackup/tar/rcp

How to keep the user/owner permission for fbackup/tar/rcp in the across network backup?
Thanks.
Hero
5 REPLIES 5
Indira Aramandla
Honored Contributor
Solution

Re: How to keep the user/owner permission for fbackup/tar/rcp

Hi,

Use the p option.

With rcp (-p) option can be used to preserve (duplicate) modification times and modes (permissions) of source files, ignoring the current setting of the umask file creation mode mask. If this option is specified, rcp preserves the sticky bit only if the target user is superuser.

If the -p option is not specified, rcp preserves the mode and owner of dest_file if it already exists; otherwise rcp uses the mode of the source file modified by the umask on the destination host. Modification and access times of the destination file are set to the time when the copy was made.

With Tar the "p" option Cause file to be restored to the original modes and ownerships written on the archive, if possible. This is the default for the superuser, and can be overridden by the o function modifier. If system protections prevent the ordinary user from executing chown(), the error is ignored, and the ownership is set to that of the restoring process.


IA
Never give up, Keep Trying
santhanakrishnan_1
Frequent Advisor

Re: How to keep the user/owner permission for fbackup/tar/rcp

HI,

As per my knowledge when ur taking backup using fbackup,tar the permission will not change..For rcp u may use the -p option..


Cheers
j773303
Super Advisor

Re: How to keep the user/owner permission for fbackup/tar/rcp

I try to use tar/rcp with -p,
yes, the permission is same as source.
but the owner are all chage to "root".
(ps: I'm in the root user to execute backup and restore" )

Is it possible keep the original user owner and group for restore files ?
Hero
Peter Godron
Honored Contributor

Re: How to keep the user/owner permission for fbackup/tar/rcp

Hi,
I think you may have a difference in environment between the machines.
If you do a tar/untar on your source machine are the ownership/permissions are maintained?

If you now copy the same tarfile onto your target machine and untar, the permissions are ok, but the userdetails are wrong?

Can you doublecheck the group matchings in /etc/groups and /etc/passwd for the user you are copying. Also please check the directory permissions.
j773303
Super Advisor

Re: How to keep the user/owner permission for fbackup/tar/rcp

Hi all,
Thanks for you all reponse. Due to the /etc/passwd user ID duplicated caused this problem.
Hero