From owner-freebsd-questions@FreeBSD.ORG Thu Jun 8 15:32:28 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AA4616D095 for ; Thu, 8 Jun 2006 13:53:42 +0000 (UTC) (envelope-from njt@ayvali.org) Received: from starfish.geekisp.com (starfish.geekisp.com [216.168.135.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87CC943D48 for ; Thu, 8 Jun 2006 13:53:41 +0000 (GMT) (envelope-from njt@ayvali.org) Received: (qmail 10718 invoked by uid 1003); 8 Jun 2006 13:53:40 -0000 Received: from clam.int.geekisp.com (HELO clam.geekisp.com) (192.168.4.38) by mail.geekisp.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 8 Jun 2006 13:53:40 -0000 Received: from clam.geekisp.com (njt@localhost.geekisp.com [127.0.0.1]) by clam.geekisp.com (8.13.4/8.12.11) with ESMTP id k58DrdnD030951; Thu, 8 Jun 2006 09:53:39 -0400 (EDT) Received: (from njt@localhost) by clam.geekisp.com (8.13.4/8.13.3/Submit) id k58Drdr2012954; Thu, 8 Jun 2006 09:53:39 -0400 (EDT) X-Authentication-Warning: clam.geekisp.com: njt set sender to njt@ayvali.org using -f Date: Thu, 8 Jun 2006 09:53:39 -0400 From: "N.J. Thomas" To: Atom Powers Message-ID: <20060608135338.GI18449@ayvali.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Cc: freebsd-questions Subject: Re: how does cron exec jobs? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2006 15:32:43 -0000 * Atom Powers [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