Privileged command as part of cronjob

Posted by user42756 on Server Fault See other posts from Server Fault or by user42756
Published on 2010-05-11T07:11:20Z Indexed on 2010/05/11 7:14 UTC
Read the original article Hit count: 232

Filed under:
|
|
|

Hi,

I'm facing a weired problem on a unix-based machine. Here is the story: I have a personal username/password on a unix machine with limited privileges. Whenever I need to execute some commands I have to substitute user using the su command, then I execute it normally. Now, I need to add a cronjob that uses such privileged commands so I added the cronjob on the crontab of the user I substituted to in order to have access to these commands. Strangely, it turned out to me that these commands fail to run for some reason as a cronjob although when I execute them directly from shell (after su) they work seamlessly.

Why does this happen? Why do these commands not work as part of cronjobs?

Thank you

© Server Fault or respective owner

Related posts about shell

Related posts about cron