Directory Default Permissions

Hi,

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.

  1. system-wide umask: it is working only when a file is created (not copied/ftpd etc.) in that directory.

  2. 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.

Any solution would highly be appreciated.

TIA
Prvn

It would help if you posted your exact requirements, otherwise we would just suggest the mechanisms you have already mentioned.

Also, do you about the SUID and SGID bits for directories? These mean any subdirectories are created with the parent directories group/user.

Thanks Porter for your response.

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.

Regards,
Prvn

Do you have a fall back position if that is not possible?

I'm not sure if i could understand your question.

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.