Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site well.UUCP Path: utzoo!linus!decvax!decwrl!amdcad!lll-crg!well!rlw From: rlw@well.UUCP (Bob Weissman) Newsgroups: net.unix,net.unix-wizards Subject: Solution to cron+script+syslog problem Message-ID: <671@well.UUCP> Date: Tue, 18-Feb-86 13:20:35 EST Article-I.D.: well.671 Posted: Tue Feb 18 13:20:35 1986 Date-Received: Thu, 20-Feb-86 00:15:53 EST Organization: Whole Earth Lectronic Link, Sausalito, CA Lines: 18 Keywords: cron shell syslog environment Xref: linus net.unix:6585 net.unix-wizards:14023 Summary: Watch out for unset vars! 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@SU-SCORE.ARPA ..!well.rlw