Solution to cron+script+syslog problem
Bob Weissman
rlw at well.UUCP
Wed Feb 19 04:20:35 AEST 1986
Thanks to all who responded to my message about being unable to do
a syslog from a C shell script under su under cron. Since I got so
many reponses (some of which were close, but not entirely right),
I thought I'd post the solution (also thereby acknowledging that I
now have the answer & y'all can stop helping now).
The problem is the lack of environment under cron. Little goodies
you expect to be set, such as $USER and $PATH don't exist. In fact
the entire environment, as printed out by printenv under cron is:
HOME=/
So the solution was to check for unset variables and set the ones you
need.
Thanks again to all respondents.
-- Bob Weissman
G.WEISSMAN at SU-SCORE.ARPA
..!well.rlw
More information about the Comp.unix
mailing list