From owner-freebsd-questions@FreeBSD.ORG Sun Sep 7 19:30:28 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 DBD0E16A4BF for ; Sun, 7 Sep 2003 19:30:28 -0700 (PDT) Received: from sccmmhc02.asp.att.net (sccmmhc02.asp.att.net [204.127.203.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id EAD2043FD7 for ; Sun, 7 Sep 2003 19:30:27 -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 sccmmhc02.asp.att.net (sccmmhc02) with ESMTP id <20030908023024mm200r6dd1e>; Mon, 8 Sep 2003 02:30:24 +0000 Received: from grond.sourballs.org (localhost [127.0.0.1]) by grond.sourballs.org (8.12.3p2/8.12.3) with ESMTP id h882TO1L001103 for ; Sun, 7 Sep 2003 19:30:23 -0700 (PDT) (envelope-from david.fleck@mchsi.com) Received: from localhost (dcf@localhost)ESMTP id h882TOOg001100 for ; Sun, 7 Sep 2003 21:29:24 -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:29:24 -0500 (CDT) From: David Fleck Sender: dcf@mchsi.com To: freebsd-questions@freebsd.org In-Reply-To: <13696.205.240.37.184.1062986048.squirrel@www.vipersystems.biz> Message-ID: <20030907212701.K1087@grond.sourballs.org> References: <13696.205.240.37.184.1062986048.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:30:29 -0000 On Sun, 7 Sep 2003, Jason Lieurance wrote: > Hello, > > We use cronolog to rotate our apache log files so are log files look like so: > > 2003-09-07-error_log > > Now, I want to make a cron job to mail the log to our webmaster every > day but I having terrible visualizing how to do it. If I do 'cat > /var/log/http/2003-09-* | mail -s log web@ourdomain.com' he'll get every > log of the month not to mention next month I'll have to edit the job. I > know I'll need to use variables but I'm drawing a blank. Please advise. Date=`date +"%Y-%m-%d"` cat /var/log/http/${Date}-error_log | mail -s log web@ourdomain.com ? -- David Fleck dcf@aracnet.com