On Tue, May 4, 2010 at 11:04 AM, Tonmaus <[email protected]> wrote: > Hi, > > How do I make sure that a script is running the same commands that the user > owning the crontab from where I am running it? > Example: As it seems, when I run the same script from bash, manually i.e. > /usr/gnu/bin/cp is used, and when the script is executed from cron, it will > use /usr/bin/cp. That duality is annoying for me, as cp has different > fucntions in both cases. What will be the best way to fix this, for the > home-grown stuff specifically, other than finding out for each command by > try-and-error.
The environment in which cron jobs run is somewhat restricted, and is pretty sure to be different from an interactive environment. If you're running a script, it's good practice to get the script to either use full paths for commands, or set the PATH at the start of the script so the environment is well defined. (And check any other environment variables your login environment may depend on.) -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/ _______________________________________________ sysadmin-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/sysadmin-discuss
