From owner-freebsd-questions@FreeBSD.ORG Fri Apr 24 15:39:34 2009 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 8F26810656DB for ; Fri, 24 Apr 2009 15:39:34 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 30B4C8FC2B for ; Fri, 24 Apr 2009 15:39:33 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id n3OFdLdf013210; Fri, 24 Apr 2009 11:39:21 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id n3OFdLx8013209; Fri, 24 Apr 2009 11:39:21 -0400 (EDT) (envelope-from jerrymc) Date: Fri, 24 Apr 2009 11:39:21 -0400 From: Jerry McAllister To: Ghirai Message-ID: <20090424153920.GA13168@gizmo.acns.msu.edu> References: <20090424180813.7e74cafb.ghirai@ghirai.com> <20090424181426.fe1706a3.ghirai@ghirai.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090424181426.fe1706a3.ghirai@ghirai.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: /etc/crontab won't run my script 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, 24 Apr 2009 15:39:35 -0000 On Fri, Apr 24, 2009 at 06:14:26PM +0300, Ghirai wrote: > On Fri, 24 Apr 2009 18:08:13 +0300 > Ghirai wrote: > > > Hi, > > > > I'm trying to get a python script to run from /etc/crontab, but it > > won't work. > > > > I've read about the most common issues being related to paths, but my > > script uses no paths at all. > > > > This is my /etc/crontab line: > > > > */5 * * * * > > munin /usr/local/bin/python /root/myscript.py > > >> /var/log/myscript.log > > > > I used munin user because i already have it (can i run it under > > 'nobody'?). > > > > This is what /var/log/cron says: > > > > Apr 24 18:00:01 triton /usr/sbin/cron[4361]: (munin) CMD > > (/usr/local/bin/python /root/myscript.py > > >> /var/log/myscript.log) > > > > > > However the script doesn't seem to run at all. > > > > Obviously it works if i run it stand-alone, as any user. > > I'm running 7.1-RELEASE-p4, i386. > > > > What am i doing wrong? > > > > Thanks. > > > > Ok i just changed 'who' column to root and it works. > Why won't it work as any other user? > Permissions for myscript.py are 555. Isn't /etc/crontab the root cron and should not be used by users? To set up a crontab for a user, do: crontab -e while logged in as that user. You can also do it from root by using the -u user_name option in the command, eg. if the user is joe crontab -u joe -e You should never edit the tab files directly. You may also have to set up /var/cron/allow and /var/cron/deny files. In addition, the ownership and permissions on the files/scripts you are trying to run from cron must be correct. ////jerry ////jerry > > -- > Regards, > Ghirai. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"