Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .