Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 2002 11:45:57 +0400
From:      Anton Shcherbinin <useperl@fastmail.fm>
To:        "Jack L. Stone" <jackstone@sage-one.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Script Question
Message-ID:  <1436526062.20020508114557@fastmail.fm>
In-Reply-To: <3.0.5.32.20020507182214.011c7318@mail.sage-one.net>
References:  <3.0.5.32.20020507182214.011c7318@mail.sage-one.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Wednesday, May 08, 2002, 3:22:14, 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.

You  could add the following line to your crontab (to be run e. g. every
midnight):

0 0 * * * /usr/bin/perl -lwe 'print "The file grew!" if -s "/path/to/the/file" > 2_000_000'

-- 
Anton


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?1436526062.20020508114557>