From owner-freebsd-questions@FreeBSD.ORG Tue Jun 17 18:30:34 2003 Return-Path: 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 B993337B401 for ; Tue, 17 Jun 2003 18:30:34 -0700 (PDT) Received: from pa-plum1b-166.pit.adelphia.net (pa-plum1b-217.pit.adelphia.net [24.53.161.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id B337243FD7 for ; Tue, 17 Jun 2003 18:30:33 -0700 (PDT) (envelope-from wmoran@potentialtech.com) Received: from potentialtech.com (working [172.16.0.95]) h5I1UWOg006011; Tue, 17 Jun 2003 21:30:33 -0400 (EDT) (envelope-from wmoran@potentialtech.com) Message-ID: <3EEFC0B8.7070704@potentialtech.com> Date: Tue, 17 Jun 2003 21:30:32 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mike McGrath References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Cron wacking out X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2003 01:30:35 -0000 Mike McGrath wrote: > Hi - > > > Right now I have a problem with my crontab. > > Here is the crontab file. > > silver-fox# crontab -l > # /etc/crontab - root's crontab for FreeBSD > # > # $FreeBSD: src/etc/crontab,v 1.21.2.3 2000/12/08 10:56:07 obrien Exp $ > # > SHELL=/bin/sh > PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin > HOME=/var/log > # > #minute hour mday month wday who command > # > */5 * * * * root /usr/libexec/atrun > # > # rotate log files every hour, if necessary > 0 * * * * root newsyslog > # > # do daily/weekly/monthly maintenance > 1 3 * * * root periodic daily > 15 4 * * 6 root periodic weekly > 30 5 1 * * root periodic monthly > # > # time zone change adjustment for wall cmos clock, > # does nothing, if you have UTC cmos clock. > # See adjkerntz(8) for details. > 1,31 0-5 * * * root adjkerntz -a > > > I keep getting these emails > > Message 5: >>From root@silver-fox.us Tue Jun 17 00:20:00 2003 > Date: Tue, 17 Jun 2003 00:20:00 -0500 (CDT) > From: root@silver-fox.us (Cron Daemon) > To: root@silver-fox.us > Subject: Cron root /usr/libexec/atrun > X-Cron-Env: > X-Cron-Env: > X-Cron-Env: > X-Cron-Env: > X-Cron-Env: > > root: not found > > And the log file /var/log/crontab > > Jun 17 00:20:00 silver-fox /usr/sbin/cron[246]: (root) CMD > (/usr/libexec/atrun) > Jun 17 00:20:00 silver-fox /usr/sbin/cron[247]: (root) CMD > (root^I/usr/libexec/atrun) > Jun 17 00:20:23 silver-fox crontab[253]: (root) LIST (root) > > So I see that ^I and root and what I am assuming is the CMD, which it really > should not be. If I am right the cron is trying to run /usr/libexec/atrun as > user root and not part of the command. I just don't get it. I have tried to > edit the crontab with crontab -e and even copied a new file over from > /usr/src/etc/crontab and then did crontab crontab to get updated. I'm lost. It looks like you've copied the system crontab to roots crontab. It appears as though the system is trying to run the command "root /usr/libexec/atrun", which doesn't exist, while at the same time the system crontab is running normally (thus the messages in your crontab log). The system crontab has the "user" field in it, so it can run commands as any user. Each user's crontab is missing that field (even root's) because it would be a security breach to allow users to change the user that their cronjobs ran under. To edit the system crontab, use your favorite editor to edit /etc/crontab. This file should have 7 fields. The 6th is the user to run the command as. To edit root's crontab, log in as root and enter 'crontab -e'. This crontab should only have 6 fields and all commands always run as root. root's crontab is treated just like any other user's. For more information, see the various man pages on crontabs. -- Bill Moran Potential Technologies http://www.potentialtech.com