Cron really runs in a minimal environment, that's why many scripts fail if run from cron, but work perfectly from the command line. It is adviseable to set explicit PATH variables etc in a script to be run using cron to avaoid this problem. As to syntax, my usual entry in cron would be something like:
If you run it from root's crontab it will runs as user root.
Ken's advise is 100% right, usually I would add the environment stuff to the script if so required, a good example would be the Java class path in some of my cases.
IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.