From owner-freebsd-isp@FreeBSD.ORG Fri Apr 1 20:01:03 2005 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73C1616A4CF for ; Fri, 1 Apr 2005 20:01:03 +0000 (GMT) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7795C43D4C for ; Fri, 1 Apr 2005 20:01:02 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id j31K0hfa088626; Fri, 1 Apr 2005 14:00:43 -0600 (CST) (envelope-from anderson@centtech.com) Message-ID: <424DA84E.4060206@centtech.com> Date: Fri, 01 Apr 2005 14:00:14 -0600 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050325 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris McElroy References: <200504011303920.SM01232@KrisLaptop> In-Reply-To: <200504011303920.SM01232@KrisLaptop> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.82/799/Fri Apr 1 04:49:13 2005 on mh1.centtech.com X-Virus-Status: Clean cc: freebsd-isp@freebsd.org Subject: Re: Cron and File Manipulation X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2005 20:01:03 -0000 Kris McElroy wrote: > First of all I am a newbie to FreeBSD and if I need to be pointed somewhere > else let me know. > > I have 2 questions > > I have a .sh script that I want to run every 25 minutes everyday > So would I do the following: > 25 * * * * root /usr/local/bin/MY.sh > > /dev/null 2>&1 > > > Also in the above script I want to add a line in my log file > > Echo >> MY SH Completed > > The thing is I would like to date and timestamp it, how could I do that? Hey Kris! Welcome to FreeBSD.. These are pretty basic Unix essentials, and you might like reading through parts of the FreeBSD handbook (available on the freebsd.org website). On your crontab, you've actually got it set to run at 25minutes after the hour, every hour, not every 25 minutes. You can have it run every 20 minutes for example, by doing this: */20 * * * * root /usr/local/bin/MY.sh > /dev/null 2>&1 That would run on any minute divisible by 20. For date/timestamping, a simple way could be: echo -n `date` >> logfile echo ": normal log text" >> logfile Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology A lost ounce of gold may be found, a lost moment of time never. ------------------------------------------------------------------------