From owner-freebsd-questions@FreeBSD.ORG Fri May 11 19:29:36 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BE6616A404 for ; Fri, 11 May 2007 19:29:36 +0000 (UTC) (envelope-from d.hill@yournetplus.com) Received: from duane.dbq.yournetplus.com (duane.dbq.yournetplus.com [65.124.230.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5278A13C45E for ; Fri, 11 May 2007 19:29:36 +0000 (UTC) (envelope-from d.hill@yournetplus.com) Received: by duane.dbq.yournetplus.com (Postfix, from userid 58) id 29D8528F87E; Fri, 11 May 2007 19:29:36 +0000 (UTC) X-Spam-ASN: X-Spam-Flag: NO X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on duane.dbq.yournetplus.com X-Spam-Level: X-Spam-Status: Reqd:5.0 Hits:-1.4 Learn:no Tests:ALL_TRUSTED=-1.44, DKIM_POLICY_SIGNSOME=0.001 Received: from duane.dbq.yournetplus.com (duane.dbq.yournetplus.com [192.168.1.10]) by duane.dbq.yournetplus.com (Postfix) with ESMTP id 9482A28F870 for ; Fri, 11 May 2007 19:29:35 +0000 (UTC) Date: Fri, 11 May 2007 19:29:35 +0000 (UTC) From: Duane Hill X-X-Sender: d.hill@duane.dbq.yournetplus.com To: freebsd-questions@freebsd.org In-Reply-To: <002001c793fd$a789bfa0$dc96eed5@ihlasnetym> Message-ID: <20070511192554.L20096@duane.dbq.yournetplus.com> References: <002001c793fd$a789bfa0$dc96eed5@ihlasnetym> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: Why crontab is not able to run some commands ? 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: Fri, 11 May 2007 19:29:36 -0000 On Fri, 11 May 2007, Halid Faith wrote: > > I have a script. As I am a root user, I can run it without a problem. I > added that script to crontab in order to run as automatic. > I entered in /etc/crontab and put down as below; > */20 * * * * root /etc/scriptfile > > Despite root user, the crontab could not run above file. But I can run the > same script in command line interface. > I am sure tha the crontab daemon is running. Also I can see the crontab try > to run that script in /var/log/cron. > /usr/sbin/cron[98727]: (root) CMD (/etc/scriptfile) > When I am a different user, I couldn't run the script and I got "access > denied" > What is the problem ? Were you either logged in as root or su'd to root when you ran the script? If so, why not just install the cron as root by: % crontab -u root -e The only change to your cron line you would have to make is to drop the username 'root'. So it would look like: */20 * * * * /etc/scriptfile