Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

A software package I installed on my Fedora box has an associated cronjob. This cronjob creates html files that need to be readable by apache. At the moment, the files are not readable because they are owned by the application's user (not apache) and not world readable.

How should I proceed in fixing this? I begun going down the path of modifying the script to either chmod or chown the html files but I've paused those efforts figuring the SU community might think of a more elegant way.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Your script can set the file creation mask to allow world readability using umask:

umask 0022

will cause any subsequently created files to be readable by group and other (rw-r--r--).

share|improve this answer
    
I was hoping for a way without actually editing the script since it is not my script and I'm hesitant to make edits only to have an automatic update revert things. –  Belmin Fernandez Oct 2 '10 at 14:44
    
@bfern: Try wrapping that script in another one that sets the umask then calls it. Have the wrapper script called by cron. –  Dennis Williamson Oct 2 '10 at 14:49
    
Thanks Mr. Williamson. This is my original thought but wanted to see if there were perhaps better solution. This would suffice though. Appreciate it! –  Belmin Fernandez Oct 2 '10 at 18:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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