[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitor the number of files in a directory?

From: Pavel Urban
Subject: Re: Monitor the number of files in a directory?
Date: Sun, 07 Jan 2007 09:37:45 +0100
User-agent: Thunderbird (Windows/20061207)

Edward A. Muller wrote:
Any idea on how I can use monit to monitor the number of files in a directory?

Mailman for some of our customers goes bonkers sometimes and just stops 
processing mail in the $MAILMANHOME/qfiles/out directory. Restarting mailman 
fixes the problem. I'd like to use monit to restart Mailman should the number 
of files in the qfiles/out directory reaches something like 50 or 100 files.

NUM=`ls -1 directory |wc -l`
if [ $NUM -lt $LIMIT ]
touch /var/tmp/flagfile

run this script via cron (for example, every 20 minutes) and do
timestamp check on /var/tmp/flagfile (or any file you decide).

Pavel Urban (address@hidden)
O2 system disaster
Telefonica O2 Czech Republic, a.s. -
   Vegetables should not operate electronic equipment.
          Computer Stupidities,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]