help-cfengine
[Top][All Lists]
Advanced

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

Re: Number of files in a directory?


From: nathan r. hruby
Subject: Re: Number of files in a directory?
Date: Thu, 10 Mar 2005 20:13:02 -0500 (EST)

On Fri, 11 Mar 2005, Tim Nelson wrote:

----BEGIN SNIP
classes:
        # See if we're overlimt
        MailqueOverLimit = ( ReturnsZero(/bin/sh -c "expr `ls
        /var/spool/mqueue/ | grep q.*| wc -l`  \> 12 > /dev/null") )

Couldn't you use the control section to set a variable to the number of whatevers (files), and then set the class based on that? It'd also allow you to use the variable in the alerts to say how many there are.


Yah, but control: gets evaluated before classes (true)?  How does one do
this without running classes: twice?  I'm still a newbie, care to share an
example of how to do this?

Most of the time cfengine is easy, but sometimes I just think like it's
p{erl,php,dksh} :)

Hmm. If I were doing it, I'd make a shell script. Of course, that would mean that alerts wouldn't work. I might also try a cfengine method.


Hmm.. I'm trying to reduce the scripties.  We have one that does this now,
in fact we have like 6 :)

Thanks!

-n
--
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------




reply via email to

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