Zentyal Forum, Linux Small Business Server

Zentyal Server => Directory and Authentication => Topic started by: blockcircuit03 on November 23, 2016, 06:44:04 am

Title: [HELP] Rsync remove root as owner
Post 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..
Title: Re: [HELP] Rsync remove root as owner
Post by: BerT666 on November 23, 2016, 08:52:55 am
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
Title: Re: [HELP] Rsync remove root as owner
Post by: blockcircuit03 on November 23, 2016, 09:36:15 am
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.
Title: Re: [HELP] Rsync remove root as owner
Post by: BerT666 on November 23, 2016, 04:06:43 pm
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