Date: Thu, 8 Jun 2006 09:53:39 -0400 From: "N.J. Thomas" <njt@ayvali.org> To: Atom Powers <atom.powers@gmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: how does cron exec jobs? Message-ID: <20060608135338.GI18449@ayvali.org> In-Reply-To: <df9ac37c0606071548vea943fas284171d21da3fbd0@mail.gmail.com> References: <df9ac37c0606071548vea943fas284171d21da3fbd0@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Atom Powers <atom.powers@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@ayvali.org Etiamsi occiderit me, in ipso sperabo
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060608135338.GI18449>