Zentyal Forum, Linux Small Business Server
Zentyal Server => Directory and Authentication => Topic started by: blockcircuit03 on November 23, 2016, 06:44:04 am
-
Please help i just created an app that will automatically copy from directory A to directory B. This app running in ROOT permission and it execute the rsync command.
The problem is Directory A and Directory B have their different permission. So what i want is can i just use rsync to copy files but remove its original permission and adopt the permission of Directory B..
Ex.
Directory A: Owner:User1 Permission:rwxrwx
Directory B: Owner:User2 Permision:rwxrwxrwx
Executing rsync -avz will just copy files and change the file owner to root and permission with rwxrwx..
-
Howdy,
you could try to set the "SUID-Bit" and "SGID-Bit" according to your needs (but I have nerer tried this...).
Kind Regards
Thomas
-
Howdy,
you could try to set the "SUID-Bit" and "SGID-Bit" according to your needs (but I have nerer tried this...).
Kind Regards
Thomas
Can you please guide me on how to do that?
Edit;
I've done already what you said but it doesn't solve my problem.
-
Hi,
I looked at the rsync parameters and fond something...
If you use -avz, the a represents (belong other options) keep user and group of the files!
Try to replace "rsync -avz" with "rsync -rlptvz". This should not keep the "original" permissions.
If there is still an issue, search the rsync parameters ;-)
Regards
Thomas