Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

First to say that I know basics of Linux systems. I am familiar with cron jobs. I am using CakePHP shell as cronjob.

The script is using model's method to download pages from site user entered. Everything works fine but when I create cron as user bokac the script doesn't have the right privileges to create folders (I am guessing that) because if I delete cronjob for that user, and switch user to www-data and create the same cron there, the script works, and creates required folders.

How to make script do that with first user, bokac ? I am not sure what or who created user www-data. Any help appreciated.

share|improve this question
did the folder in which the cron is working has permissions for the user bokac?? – harish.venkat Jan 14 '13 at 15:26
I am not sure where to find crontab. When I save it, it is in tmp dir, but there is no directory there for cron. Does that matter? – skywalker Jan 14 '13 at 15:48
did you try this – harish.venkat Jan 14 '13 at 16:09
I tried this solution, as I said, it works with crontab under www-data. I am not sure if that is a security risk maybe? Also when files are created, they appear locked to a bokac user.. – skywalker Jan 14 '13 at 18:31
On many (not all) distributions, www-datais the user under which the Apache web server runs. This also means that everything done by Apache (especially including PHP scripts) will be done with the permissions of user www-data (and also group www-data) by default.So one work around is add user bokac to group www-data hope this helps :-) – harish.venkat Jan 14 '13 at 18:49

Your Answer


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

Browse other questions tagged or ask your own question.