From owner-freebsd-questions@FreeBSD.ORG Fri Mar 24 21:53:54 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 8088416A425 for ; Fri, 24 Mar 2006 21:53:54 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1980243D46 for ; Fri, 24 Mar 2006 21:53:53 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [192.168.2.2] ([69.27.149.254]) by ezekiel.daleco.biz (8.13.4/8.13.1) with ESMTP id k2OLqkI0091768; Fri, 24 Mar 2006 15:53:07 -0600 (CST) (envelope-from kdk@daleco.biz) Message-ID: <44246A23.70905@daleco.biz> Date: Fri, 24 Mar 2006 15:52:35 -0600 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060127 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Rodrigo G. Tavares de Souza" References: <44245730.9030509@sensorsistemas.com.br> In-Reply-To: <44245730.9030509@sensorsistemas.com.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: crontab doesn't work 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 Mar 2006 21:53:54 -0000 Rodrigo G. Tavares de Souza wrote: > Hi, > > Do I have to start something to crontab works? > > configuration file: > # MIN HOUR DAY/MONTH MONTH DAY/WEEK USER COMMAND > 59 23 * * * root > "/usr/local/etc/sarg/make-report" > 0 0 * * 0 squid > "/usr/local/etc/sbin/squid -k rotate" > > It should generate a report every day, and clear > the log file every week, but it isn't hapaning! > What do I suppose to do? > > Best regards > Rodrigo Souza > Analista Programador > Sao Paulo - Brazil Hello, Rodrigo 1. Is cron running now? Can you find any mention of cron in your logs (esp /var/run/dmesg/boot)? Does it get mentioned in the boot process (watch the screen)... cron should be started by init(8) as part of the rc(8) process (the last of the boot stage, prior to going multi-user). 2. Just out of curiousity and a desire to help, what's the path to the "configuration file" above? :) 3. Reasoning: It appears that you have modified /etc/crontab. In BSD-land, you usually want to use the "root" crontab (which is under /var/cron/tabs/root) or your personal account crontab (/var/cron/tabs/username) to do cron work. However, you don't want to edit this file directly. Make sure $EDITOR is set to your favorite text editor and run "crontab -e" to set up your crontab. Exit the editor, and crontab(1) will put the file in place for you. Incidentally, this may be the cause of your problem entirely. (See the FAQ, 10.3, 'Why do I get messages like "root: not found" after editing my crontab file?'). 4. I'm sure you're aware of cron's limited $PATH and other limitations. Make sure your scripts are executable and "shebanged", or else call them with the appropriate shell interpreter's full pathname, e.g. (/bin/sh ~/scripts/mybackup.sh). HTH, Kevin Kinsey -- WARNING TO ALL PERSONNEL: Firings will continue until morale improves.