LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change file owner in a directory (https://www.linuxquestions.org/questions/linux-newbie-8/change-file-owner-in-a-directory-4175441060/)

ust 12-11-2012 10:59 PM

change file owner in a directory
 
I have a directory , many files from different users will copy files to it , so there are many file owners in this directory , if I would like to make all file owner are a specific user , that means once the files are copy to this different , then change its owner to a specific user , I know I an set a cron job , but it seems too last to change owner as I would like do it real time when the files are created .

can advise what can I do ?

thanks

shivaa 12-11-2012 11:31 PM

Did you try anything so far? It can be done using chown cmd, with recurssive option:
Code:

chown -R new_owner /path/to/dir
Well, as far as I know, there's no way to change owner as soon as a new file gets created inside that directory. But in such situation, to protect data or for availability of data to all memebers of a group/project, you can go with SGID and Sticky bit utilities.


All times are GMT -5. The time now is 07:32 AM.