help-cfengine
[Top][All Lists]
Advanced

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

Re: "tidy" not deleting files from the future


From: Paul Krizak
Subject: Re: "tidy" not deleting files from the future
Date: Tue, 13 Dec 2005 16:20:55 -0600
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Perhaps "scale" isn't the best term. The "scaling" I was referring to is the amount of code complexity for what should be an incredibly simple operation. For every file/directory you want to delete, whereas it should require only one extra line in a tidy: statement, setting classes and stuff to do the same thing means adding (at a minimum) two lines of code (one to set the class, one to delete the file), not to mention the fact that you now have the same information ("This file will be deleted") in three places: a shellcommands block, a classes: block, and implicitly through the definition of the class.

It shouldn't be necessary to resort to a shellcommand or extra classes just to force a file to disappear from the system. "age=0", to me, means "no matter how old it is, delete it!", aka "force".

Unfortunately that is not the case. While I have workarounds in place for situations like the one I describe here, I would like to see future versions of cfengine do the "right thing" in this situation, or at least provide some way of letting "tidy" throw caution to the wind and just blow away whatever files it is told to.

"disable" sounds like a suitable workaround for some things (though I do not know if it is susceptible to the time shift problem), but there are many cases where I just want the file *gone*.

Paul Krizak                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, TX  78741
Linux/Unix Systems Engineering      Phone: (512) 602-8775
Microprocessor Solutions Sector


Brendan Strejcek wrote:
Paul Krizak wrote:


yeah that's not exactly what I'm looking for either. It doesn't scale
at all for large groups of files, nevermind big trees of stuff (for
example, we delete /usr/local, all of it, during install).


How does tidy scale better? You could use IsDir rather than FileExists
along with the -r option or "find" with some criteria and a -exec
option.

Here is a hack to get a big recursive delete to return quickly:

    /bin/sh -c '( /bin/rm -rf /some/path & )'


Usually when we need to do a true "force" of a delete, we just do a
shellcommand of rm -f, and let it keep trying to delete the missing
files forever.


Hmm, I would at least wrap it with a class like my previous example.


I'd much rather use tidy in all situations, however.


"disable" might also be an option.

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science

http://www.cs.uchicago.edu/people/brendan
http://people.cs.uchicago.edu/~brendan





reply via email to

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