I have a directory with files and sub-directories. Users write files to it by using copy/create/tar/ftp etc.
I want this directory to have default permissions of 775 (for its files and sub-dir as well). I tried the below 2 ways but they are not upto my exact requirement so i need a better way of doing it.
system-wide umask: it is working only when a file is created (not copied/ftpd etc.) in that directory.
CRON job for setting permissions: As there're millions of files, resetting permissions periodically (using cron) found to be impacting on server performance. I tried applying chmod only on the recent files but still it's taking long enough to keep server loaded.
My Exact requirement is to have each and every file/directory being copied/created/ftped/tared (or by any means) to a specific directory, must get 775 permissions automatically.
I don't have files/directories set with SUID/SGID.
Right now, i'm managing with periodic chmod on recent files which is considered inefficient. If there's no better solution to my requirement, i would go with this only.