From owner-freebsd-questions Tue May 7 17:25:57 2002 Delivered-To: freebsd-questions@freebsd.org Received: from sage-one.net (adsl-65-71-135-137.dsl.crchtx.swbell.net [65.71.135.137]) by hub.freebsd.org (Postfix) with ESMTP id BCF2837B40D for ; Tue, 7 May 2002 17:25:33 -0700 (PDT) Received: from SAGEONE (sageone [192.168.0.5]) by sage-one.net (8.11.6/8.11.6) with SMTP id g480PTb52558; Tue, 7 May 2002 19:25:29 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20020507192527.011c7318@mail.sage-one.net> X-Sender: jackstone@mail.sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Tue, 07 May 2002 19:25:27 -0500 To: Andrew From: "Jack L. Stone" Subject: Re: Script Question Cc: freebsd-questions@freebsd.org In-Reply-To: <20020508101358.W75721-100000@starbug.ugh.net.au> References: <3.0.5.32.20020507182214.011c7318@mail.sage-one.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 10:14 AM 5.8.2002 +1000, Andrew wrote: > > >On Tue, 7 May 2002, Jack L. Stone wrote: > >> Am running FBSD 4.5 and would like to come up with a simple script that >> could monitor a file size, say 2MB and then send an email notice once 2MB >> is reached. I would use cron to run it on intervals. > >#!/bin/sh > >AWK=/usr/bin/awk >FILE=foo >LS=/bin/ls >SIZE=2048 > >if [ `${LS} -s ${FILE} | ${AWK} '{ print $1 }'` -gt ${SIZE} ]; then > echo File ${FILE} is too large >fi > >Andrew > Ah...yes, thanks Andrew! .... our website: http://www.sage-one.net/ Best regards, Jack L. Stone Server Admin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message