-   Linux - Newbie (
-   -   Cronjob for Root (

ryanlum 06-24-2008 05:24 AM

Cronjob for Root
Hey Guyz,

I was doing some monitoring script. When i run it as a normal user, the script comes out good.

After i inserted it into a crontab. I am not able to use commands like ifconfig, free. Is there anyway to go around it?

billymayday 06-24-2008 05:30 AM

Put the full path to the command - crontab doesn't inherit the user's $PATH

ryanlum 06-24-2008 05:42 AM

thx for the quick reply,

is it possible if i put the $PATH into the crontab??

chrism01 06-25-2008 12:45 AM

Only if you use the normal user's crontab; don't alter the root one like that.

Mr. C. 06-25-2008 03:45 AM

You can set PATH in crontabs. Just be sure the PATH components you add do not introduce security risks (eg. not a good idea to add a user's home directory)

All times are GMT -5. The time now is 07:26 PM.