Date: Wed, 8 May 2002 10:14:48 +1000 (EST) From: Andrew <andrew@ugh.net.au> To: "Jack L. Stone" <jackstone@sage-one.net> Cc: freebsd-questions@freebsd.org Subject: Re: Script Question Message-ID: <20020508101358.W75721-100000@starbug.ugh.net.au> In-Reply-To: <3.0.5.32.20020507182214.011c7318@mail.sage-one.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020508101358.W75721-100000>