Why crontab is not able to run some commands ?

James Anderson baka.rob at gmail.com
Fri May 11 20:07:04 UTC 2007


On 5/11/07, Halid Faith <maslak at ihlas.net.tr> wrote:
>
> I have a script. As I am a root user,  I can run it without a problem. I
> added that script to crontab in order to run as automatic.
> I entered in /etc/crontab and put down as below;
> */20     *       *       *       *       root    /etc/scriptfile
>
> Despite root user, the crontab could not run above file. But I can run the
> same script in command line interface.

Which command are you using to run the script on the command line?
Are you just typing out /etc/scriptfile into the shell prompt, or are
you running "sh /etc/scriptfile" or running it via some other
interpreter?

> I am sure tha the crontab daemon is running. Also I can see the crontab try
> to run that script in /var/log/cron.
> /usr/sbin/cron[98727]: (root) CMD (/etc/scriptfile)

Which indication do you have that cron ISN'T running the script?

> When I am a different user, I couldn't run the script and I got "access
> denied"
> What is the problem ?

Which file permission does /etc/scriptfile have? (ls -l /etc/scriptfile)

Maybe the other user doesn't have read and/or execute permission?

Sincerely,
-Parker


More information about the freebsd-questions mailing list