From owner-freebsd-questions@FreeBSD.ORG Sun Sep 7 19:57:51 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 4EE2116A4BF for ; Sun, 7 Sep 2003 19:57:51 -0700 (PDT) Received: from sccimhc02.asp.att.net (sccimhc02.asp.att.net [63.240.76.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5376443F93 for ; Sun, 7 Sep 2003 19:57:50 -0700 (PDT) (envelope-from david.fleck@mchsi.com) Received: from grond.sourballs.org (12-216-14-105.client.mchsi.com[12.216.14.105]) by sccimhc02.asp.att.net (sccimhc02) with ESMTP id <20030908025749im2006j9cje>; Mon, 8 Sep 2003 02:57:49 +0000 Received: from grond.sourballs.org (localhost [127.0.0.1]) by grond.sourballs.org (8.12.3p2/8.12.3) with ESMTP id h882vG1L001168 for ; Sun, 7 Sep 2003 19:57:48 -0700 (PDT) (envelope-from david.fleck@mchsi.com) Received: from localhost (dcf@localhost)ESMTP id h882vFcn001165 for ; Sun, 7 Sep 2003 21:57:16 -0500 (CDT) (envelope-from david.fleck@mchsi.com) X-Authentication-Warning: grond.sourballs.org: dcf owned process doing -bs Date: Sun, 7 Sep 2003 21:57:15 -0500 (CDT) From: David Fleck Sender: dcf@mchsi.com To: freebsd-questions@freebsd.org In-Reply-To: <14243.205.240.37.184.1062989058.squirrel@www.vipersystems.biz> Message-ID: <20030907214740.E1157@grond.sourballs.org> References: <13696.205.240.37.184.1062986048.squirrel@www.vipersystems.biz> <20030907212701.K1087@grond.sourballs.org> <14243.205.240.37.184.1062989058.squirrel@www.vipersystems.biz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: Making a certain cron job 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: Mon, 08 Sep 2003 02:57:51 -0000 On Sun, 7 Sep 2003, Jason Lieurance wrote: > Thank you for the response. Does the date part (Date=`date +"%Y-%m-%d"`) > go as part of the cron job? Thanks again. Well, you could cram all this into a crontab line, but you'll probably want to use the cron entry to run a script containing these commands. This way, you can make the script more elaborate, do error-checking, have possible alternate responses mailed, things like that. For what you want to do, the script could be very simple: #!/bin/sh # send_http_log.sh : mails httpd logfile. Date=`date +"%Y-%m-%d` cat /var/log/http/${Date}-error_log | mail -s log web@ourdomain.com exit and then in the crontab have a line referring to the script: 0 1 * * * /usr/local/bin/send_http_log.sh or, alternately, add the script into the /etc/periodic/* directories to have it run by the system-wide cron. -- David Fleck dcf@aracnet.com