From owner-freebsd-questions@FreeBSD.ORG Fri Aug 22 10:50:05 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 0EE6B16A4C0 for ; Fri, 22 Aug 2003 10:50:05 -0700 (PDT) Received: from smtpzilla2.xs4all.nl (smtpzilla2.xs4all.nl [194.109.127.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3AEF4402A for ; Fri, 22 Aug 2003 10:50:03 -0700 (PDT) (envelope-from rick@paranoia.nl) Received: from paranoia (paranoia.xs4all.nl [80.126.151.201]) by smtpzilla2.xs4all.nl (8.12.9/8.12.9) with ESMTP id h7MHo1co062450; Fri, 22 Aug 2003 19:50:01 +0200 (CEST) Date: Fri, 22 Aug 2003 19:48:58 +0200 From: Rick Hoekman X-Mailer: The Bat! (v1.62i) Personal Organization: Paranoia X-Priority: 3 (Normal) Message-ID: <6354193152.20030822194858@paranoia.nl> To: Matthew Seaman In-Reply-To: <20030822174159.GA93473@happy-idiot-talk.infracaninophile.co.uk> References: <144352351144.20030822191816@paranoia.nl> <20030822174159.GA93473@happy-idiot-talk.infracaninophile.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re[2]: Cron job question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Rick Hoekman List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2003 17:50:05 -0000 Hello Matthew, Thank you for taking the time explaining it to me! Rick Friday, August 22, 2003, 7:41:59 PM, you wrote: MS> On Fri, Aug 22, 2003 at 07:18:16PM +0200, Rick Hoekman wrote: >> I am getting this message every 5 minutes. Can somebody explain to me >> why root apparently is not found here? >> >> >> X-Original-To: root@somedomain.nl >> Delivered-To: root@hoekmansysteembeheer.nl >> From: root@somedomain.nl (Cron Daemon) >> To: root@hoekmansysteembeheer.nl >> Subject: Cron root /usr/libexec/atrun >> X-Cron-Env: >> X-Cron-Env: >> X-Cron-Env: >> X-Cron-Env: >> X-Cron-Env: Date: Fri, 22 Aug >> 2003 19:05:00 +0200 (CEST) root: not found >> MS> You've made the classic mistake of confusing the system crontab MS> (/etc/crontab) and the user specific crontabs that live in MS> /var/cron/tabs. These are quite different files. MS> The system crontab /etc/crontab is not user specific: thus it has an MS> extra column defining which user ID the command should be run as. In MS> general you shouldn't need to touch this file at all -- it's where MS> standard stuff like the 'at' queue, newsyslog and the MS> daily/weekly/monthly periodic functions are run from. If you must MS> alter this file, just edit it directly: cron(8) will pick up the MS> changes in a minute or so. In particular you do not need to use MS> crontab(1) to manage this file. MS> The per-user crontabs are what you would expect if you're familiar MS> with the SysV or Linux style cron(8) daemon. Each user has their own MS> crontab file, which is managed using the crontab(1) command. In MS> general it's a good policy to use the per-user crontab stuff to add MS> any new cron jobs for any user (including root) and leave the system MS> /etc/crontab in it's default state. MS> The error you're seeing suggests to me that what you've done is run MS> crontab(1) on /etc/crontab, and the extra column containing the userid MS> is being interpreted as a command that cron should run. However, MS> there is no command 'root', hence the error message. To fix, make MS> sute that /etc/crontab contains the default contents by copying over MS> /usr/src/etc/crontab or running mergemaster(1). Backup and delete the MS> root crontab you've generated: MS> # crontab -l -u root > /tmp/root.crontab MS> # crontab -r -u root MS> Now, if root.crontab contains substantively the same as /etc/crontab, MS> you're done. Otherwise, if you need to add some extra root cron jobs, MS> edit /tmp/root.crontab to strip out the default stuff, leaving only MS> you extra jobs. Don't put a username in column 6 of the file: rather MS> that should be the last column and contain the command to run, as per MS> crontab(5). Once edited to your liking load the new crontab file into MS> the system: MS> # vi /tmp/root.crontab MS> # crontab -u root /tmp/root.crontab MS> Cheers, MS> Matthew