how does cron exec jobs?

N.J. Thomas njt at ayvali.org
Thu Jun 8 15:32:43 UTC 2006


* Atom Powers <atom.powers at gmail.com> [2006-06-07 15:48:35 -0700]:
> I have a cronjob ( cfexecd -F ) that often hangs; but no matter how I
> run it from the shell ( sh -c "cfexecd -F" & ) it never hangs.
> 
> How can I simulate a cron job from the shell?

Whenever you have a problem like this (ie. "foo works perfectly from the
command line but not from cron"), you should always run /usr/bin/env (or
/bin/env) from cron, and then manually run your script with that same
environment (unsetting any envariables you need to get your shell to
match that of the cron environment) -- that will show you fairly quickly
what is wrong.

Usually it is just a PATH issue, but sometimes it may be some missing
envariable that you didn't even realize existed (that your script
depended on it).

Thomas

-- 
N.J. Thomas
njt at ayvali.org
Etiamsi occiderit me, in ipso sperabo


More information about the freebsd-questions mailing list