Paul Rimmer wrote: > > > Clearly, $HOSTNAME is *not* in the environment for whatever user is > > executing your cron job. > > cron is a root process (I assume this means multicron-p will be executed as > root?) and I am logged in as root when I successfully use the $HOSTNAME > global from the command line. If I can succesfully use the $HOSTNAME global > from the command line while logged in as root doesn't that suggest it is a > known value? Is there a command equivalent to "env" to check all available > environment variables? > > > Does /etc/profile contain this line? > > > > export HOSTNAME="$(hostname)" > > Yes it does. > > > At anyrate, this is how $HOSTNAME gets it value under DCD. I vaguely > > remember having problems with multicron-p and one of my working changes > > is to include this line immediately prior to the call to main(): > > > > PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > > > > Nevertheless, there is nothing wrong with your use of $(hostname), since > > that is the call used to set HOSTNAME to begin with . . . > > Now that I have it working it's more out of curiosity to know why it isn't > OK the default way. Who knows, maybe other scripts on my LRP box aren't > working for the same reason. > > Maybe it has something to do with what Dave Douthitt mentioned:
Actually, that is precisely what I said, ``Clearly, $HOSTNAME is *not* in the environment for whatever user is executing your cron job.'' Since the sixth field in /etc/crontab is changeable, I dare not assume that root is running your multicron-p ;< > "The general answer to a question of this type (i.e., why does this > command work at the command line, but not when run from cron?) is that > in the environment set during the execution of a script run from cron, > there are only about SIX environment variables set, and much of the > environment found in a command line environment is missing. > > However, in using standard scripts for Dachstein, this should not be a > problem - but it occurs often enough that I thought I should mention > it." > > Any ideas on what should I check to rule this out Dave? Add this to /etc/multicron-p: environment () { { echo echo "$(set)" } | mailadmin "Environment List" } Then, make sure that periodic contains the new function: periodic () { environment checkfreespace pingcheck } Now, wait for cron to act on this -- fortunately, with multicron-p, you won't have to wait long ;> Finally, try the same thing by adding this immediately prior to main(): PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin What do you think? -- Best Regards, mds mds resource 888.250.3987 Dare to fix things before they break . . . Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . _______________________________________________ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user