[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: |
Tue, 15 Mar 2005 09:42:24 -0500 (EST) |
On Tue, 15 Mar 2005, Mark Burgess wrote:
control:
MailQueueCount = ( ExecResult(find /var/spool/mqueue -type f -name 'q*'
| wc -l )
classes:
MailqueOverLimit = ( ReturnsZero(/usr/bin/test $(MailQueueCount) -ge
12) )
Warning; completely untested, but it hopefully indicates the way I
was thinking. Mark, does this mean that boolean operations would be a
good idea in cfengine?
I don't know what you mean by a boolean operation.
Well, at least a few additional "operators" like "less than" or "greater
than" which return true/false to set a class to prevent this kind of
senseless abuse of fork() :)
control:
x = ( ExecResult( something-big ) )
y = ( ExecResult( something-small ) )
classes:
XisBiggerThanY = ( GreaterThan( $(x) $(y) ) )
Yeah, this looks perl-esque, but I think a few extra operators would be
handy (We already have a substr() ).. I see there are already tests like
this in the cmp= operator for packages: and bymatches= for processes: so
it might make sense to refactor that code into something for more general
use?
Of course, I could be totally wrong and possibly drain bamaged. YMMV.
--- BEGIN PIE IN THE SKY WISHES ---
Even better would be a hook to directories that allows one to generate an
action or set a class based on both high a low watermarks:
directories:
SomeHost::
/path/to/dir
maxfiles=1000
minfiles=2
define=DespoolSomeAppQueue
Hitting maxfiles would define the classes in define=, hitting minfiles
would act similarly to the way SensibleCount does currently.
Maybe this would be better suited as its own action "filecount:"
Maybe for cfengine-3...
--- END PIE ---
Thanks!
-n
--
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
metaphysically wrinkle-free
-------------------------------------------
- Number of files in a directory?, nathan r. hruby, 2005/03/10
- Re: Number of files in a directory?, Adams, Russell L., 2005/03/10
- Re: Number of files in a directory?, Tim Nelson, 2005/03/10
- Re: Number of files in a directory?, nathan r. hruby, 2005/03/10
- Re: Number of files in a directory?, Tim Nelson, 2005/03/14
- Re: Number of files in a directory?, Mark Burgess, 2005/03/15
- Re: Number of files in a directory?,
nathan r. hruby <=
- Re: Number of files in a directory?, Mark Burgess, 2005/03/15
- Re: Number of files in a directory?, Tim Nelson, 2005/03/16
Re: Number of files in a directory?, Mark Foster, 2005/03/10
Re: Number of files in a directory?, Noah, 2005/03/10