I have a programm which creates log files in web-server directory (/var/www/log). Every day it generates one new log file. I've set access permissions for this directory to 777

chmod 777 -R /var/www/log

But when system generates log file for new day, it doesn't have access permissions 777. I have to do it manually again. How can I correctly set permissions for directory? All files in this directory must have 777 automatically.

  • 4
    Why would a log directory ever need god mode?
    – nerdwaller
    Nov 25 '13 at 20:54
  • Can you have to logs go elsewhere? Like the home directory?
    – Kruug
    Nov 25 '13 at 21:18
  • 3
    Why give log files execute permissions? Nov 25 '13 at 21:19

The access permissions on a directory do not determine the access permissions for a file in that directory in Linux; they are not inherited.

Either change the umask(2) of the program that writes the logfiles, or change the settings of the program that rotates the logfiles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.