From owner-freebsd-questions Mon Aug 21 12:42: 5 2000 Delivered-To: freebsd-questions@freebsd.org Received: from falcon.scana.com (falcon.scana.com [161.156.101.7]) by hub.freebsd.org (Postfix) with ESMTP id 264FC37B43C for ; Mon, 21 Aug 2000 12:42:02 -0700 (PDT) Received: by falcon.scana.com; id PAA04640; Mon, 21 Aug 2000 15:41:55 -0400 (EDT) Received: from maildmis.scana.com(161.156.252.68) by falcon.scana.com via smap (V5.5) id xma004585; Mon, 21 Aug 00 15:41:01 -0400 Received: from msg11.scana.com [161.156.252.68] by msg11.scana.com [161.156.252.68] (CMSPraetor 4.1.3395) with ESMTP id 88D9C11D776E11D4B3F400A0C98F15C0 for plus 1 more; Mon, 21 Aug 2000 15:38:31 -0400 Received: by maildmis.scana.com with Internet Mail Service (5.5.2650.21) id ; Mon, 21 Aug 2000 15:38:31 -0400 Message-ID: From: "SILVER, MICHAEL A" To: "'freebsd-questions@freebsd.org'" Cc: "'Murray's Listserv Account'" Subject: RE: how to clip&email last lines of log file Date: Mon, 21 Aug 2000 15:38:31 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG It's been sometime since I used it, but I think tail will do the trick. There is an option to specify the number of lines you want returned. I don't have the man pages with me, otherwise I would provide the syntax you are looking for. ...Michael... > -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Murray's > Listserv Account > Sent: Monday, August 21, 2000 3:28 PM > To: freebsd-questions@freebsd.org > Subject: how to clip&email last lines of log file > > > I have written a .sh script and use cron to email a log file > to my email account > on a daily basis. I could easily delete the previous day's log account > before the current day's log is created but I wish to have a > historical account of the log. Alternatively, I could create two logs: > running and daily and delete the daily... But, I started thinking > about clipping the last lines of a log and emailing the last lines. > For example, the log entries for each day are only 6 lines each. How > do you clip lines from a file. The .sh scripts are run as root and > root uses the csh shell. I do not have the perl port installed. Is > there a shell script/command that would do the job? > > Reply-To: > -- > Murray Davis > Converging Technology Solutions > Edmonton, AB > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message