From owner-freebsd-questions@FreeBSD.ORG Sun Sep 7 19:44:21 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 15B1016A4BF for ; Sun, 7 Sep 2003 19:44:21 -0700 (PDT) Received: from redhat.vipersystems.biz (user198.net263.oh.sprint-hsd.net [208.17.71.198]) by mx1.FreeBSD.org (Postfix) with SMTP id C836543FE0 for ; Sun, 7 Sep 2003 19:44:19 -0700 (PDT) (envelope-from jason@vipersystems.biz) Received: (qmail 481 invoked by uid 85); 8 Sep 2003 02:44:19 -0000 Received: from jason@vipersystems.biz by redhat.vipersystems.biz by uid 82 with qmail-scanner-1.16 (clamscan: 20030613. spamassassin: 2.55. Clear:. Processed in 0.43444 secs); 08 Sep 2003 02:44:19 -0000 Received: from localhost (HELO vipersystems.biz) (127.0.0.1) by localhost with SMTP; 8 Sep 2003 02:44:18 -0000 Received: from 205.240.37.184 (SquirrelMail authenticated user jason@vipersystems.biz) by www.vipersystems.biz with HTTP; Sun, 7 Sep 2003 22:44:18 -0400 (EDT) Message-ID: <14243.205.240.37.184.1062989058.squirrel@www.vipersystems.biz> Date: Sun, 7 Sep 2003 22:44:18 -0400 (EDT) From: "Jason Lieurance" To: In-Reply-To: <20030907212701.K1087@grond.sourballs.org> References: <13696.205.240.37.184.1062986048.squirrel@www.vipersystems.biz> <20030907212701.K1087@grond.sourballs.org> X-Priority: 3 Importance: Normal X-Mailer: SquirrelMail (version 1.2.12[cvs]) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit cc: freebsd-questions@freebsd.org 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:44:21 -0000 Hello, Thank you for the response. Does the date part (Date=`date +"%Y-%m-%d"`) go as part of the cron job? Thanks again. -- Jason David Fleck said: > 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 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"