From owner-freebsd-questions@FreeBSD.ORG Fri Mar 12 07:44:31 2004 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 6AA1516A4CE for ; Fri, 12 Mar 2004 07:44:31 -0800 (PST) Received: from ns1.tiadon.com (SMTP.tiadon.com [69.27.132.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03ABB43D46 for ; Fri, 12 Mar 2004 07:44:31 -0800 (PST) (envelope-from kdk@daleco.biz) Received: from daleco.biz ([69.27.131.0]) by ns1.tiadon.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 12 Mar 2004 09:44:56 -0600 Message-ID: <4051DAD9.7080306@daleco.biz> Date: Fri, 12 Mar 2004 09:44:25 -0600 From: "Kevin D. Kinsey, DaleCo, S.P." User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040212 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dave Carrera References: <003301c40815$c94ba5d0$0301a8c0@daveslaptop> In-Reply-To: <003301c40815$c94ba5d0$0301a8c0@daveslaptop> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Mar 2004 15:44:56.0828 (UTC) FILETIME=[F837A3C0:01C40848] cc: Franky-Mueller@web.de cc: freebsd-questions@freebsd.org Subject: Re: Cron job questions 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: Fri, 12 Mar 2004 15:44:31 -0000 Dave Carrera wrote: >Hi Frank, > >So if I > >#ee /etc/crontab (I prefer ee to vi ) > >Add this > >* 2 * * * root /bin/csh /root/script.csh > >Save exit > >That should run my script at 2am every morning yes ? > >Spaces above are tabs in keeping with what is in my crontab already (entries >by someone else's) > >Thanks for your help > >Dave C > > > At the risk of making you hate my name in your inbox ... no, no, no, please? :-) You should use "crontab -e" as someone already noted. If you prefer ee to vi (I don't vi, either), then your environment should specify this, so that "crontab -e" puts you in an ee session on */var/cron/tabs/root* instead of a vi session on the same file. */etc/crontab* is the *system* crontab, (that's why there are "entries by someone else"), the format is different, and doing this is the cause of one of the FAQ errors on this list (something to the effect of "why does cron mail me saying "root: not found") ..... To set ee as your EDITOR in csh/tcsh: $setenv EDITOR ee note that this will only last as long as your login session, so you will actually want to put this line in your $HOMEDIR/.cshrc so it will be part of your environment every time you log in. In sh/bash, etc.: $EDITOR=ee && export EDITOR You should also place these lines (probably seperately instead of w/'&&' as I showed you) in your .shrc, .bashrc, .login or .profile.... This is best practice, because this environment variable is not only used with "crontab -e", but also with "vipw", "visudo" (if installed), etc., etc., etc.... HTH, Kevin Kinsey DaleCo, S.P. PS> for crontab syntax: $man 5 crontab Here's a short teaser #min hour day mon weekday command */5 * * * * /usr/bin/php -q /home/me/scripts/move.php > /dev/null 2>&1 @reboot /usr/sbin/ndc start