From owner-freebsd-questions@FreeBSD.ORG Thu Jul 17 02:03:13 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC0BA1065670 for ; Thu, 17 Jul 2008 02:03:13 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id 580678FC16 for ; Thu, 17 Jul 2008 02:03:12 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 79911 invoked by uid 89); 17 Jul 2008 02:03:12 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 17 Jul 2008 02:03:12 -0000 In-Reply-To: <20080716113718.b165f10c.wmoran@potentialtech.com> References: <3BC71C1E-DD8B-4FD9-870A-A2D385E556C8@identry.com> <20080716113718.b165f10c.wmoran@potentialtech.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit X-Marketcircle-Dmi-Agent: From: John Almberg Date: Wed, 16 Jul 2008 22:03:10 -0400 To: Bill Moran X-Mailer: Apple Mail (2.752.3) Cc: freebsd-questions@freebsd.org Subject: Re: how to simulate a user's crontab? 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, 17 Jul 2008 02:03:13 -0000 > > I'm guessing you're having problems with environment settings, > although > the vagaries of the question don't give me much to go on (something > along the lines of, "when I try to do x in cron, I get the error y; > but it works fine when the user runs it outside of cron" would be more > informative.) > Well, this got me thinking and I had to do some playing around to figure out what was wrong... The difference was that I was testing the command by su-ing into the user, rather than logging in as that user. What I didn't know was su does not change your environment, only permissions (as far as I can tell) So I was testing with my environment, but crontab was running under the other user's environment. I always thought that su user and login user were equivalent. Now I know better :-) Anyway, thanks for putting me on the right path. -- John