Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Mark Burgess
It is also true that a search of "one" is a search, so I think Seva is right to point out this issue, M daniel.kl...@cfengine.com wrote: > This is the root of the problem: > > file_select implies a search - and the only way you can have a search is > either with depth_search or a wildcard in t

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread daniel . klein
This is the root of the problem: file_select implies a search - and the only way you can have a search is either with depth_search or a wildcard in the filename I believe this is also a bug, in that Cfengine should tell you when you have a promise that cannot be satisfied, and requires a componen

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Mark Burgess
Never mind, I found it Seva Gluschenko wrote: > Mark, > > here it is: > > files: > "$(sys.workdir)/promise.log" > file_select => size_exceeds("1M"), > rename => rotate("2"), > depth_search=> recurse("1"), >

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Mark Burgess
This is not the promise that gave you a message about needing depth search for rename. Can you show me how you got that message please? Seva Gluschenko wrote: > Mark, > > here it is: > > files: > "$(sys.workdir)/promise.log" > file_select => size_exceeds("1M"), >

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Seva Gluschenko
Well, I've foreseen such an answer ) Anyway, in my humble opinion the approach is just wrong. 2010/6/4 Nakarin Phooripoom : > Then, you should do something like the following; changing the promiser to a > parent directory and using file_select to match the file name. Haven't test > but it shoul

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Nakarin Phooripoom
Then, you should do something like the following; changing the promiser to a parent directory and using file_select to match the file name. Haven't test but it should work. :-) files: "/var/cfengine" file_select => size_exceeds("promise\.log","1M"), depth_search => recurse("1"),

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Seva Gluschenko
Nakarin, this way you can only define timed rotation (by means of action => if_elapsed or by classes), but not size-based rotation. To define size-based rotation, I use file_select, but it wants depth_search from me. I believe, depth_search requirement must be suppressed for file promises. 2010/6

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Mark Burgess
I think this is some kind of logic error :) Nakarin Phooripoom wrote: > Do we really need to include depth_search to rotate a file? > > file: >"/var/cfengine/promise.log" > rename => rotate("3"); > > Cheers, > --Nakarin > > On Jun 4, 2010, at 8:46 AM, Seva Gluschenko wrote: > >> Hel

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Nakarin Phooripoom
Do we really need to include depth_search to rotate a file? file: "/var/cfengine/promise.log" rename => rotate("3"); Cheers, --Nakarin On Jun 4, 2010, at 8:46 AM, Seva Gluschenko wrote: > Hello folks, > > When I wrote a promise to rotate /var/cfengine/promise.log (BTW, why > Cfengine

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Seva Gluschenko
Doh, now I have another warning: -> Warning: File select constraint body promised but no depth search indicated Can I get rid of warnings please? 2010/6/4 Seva Gluschenko : > Mark, > > here it is: > >  files: >        "$(sys.workdir)/promise.log" >                file_select     => size_exceed

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Seva Gluschenko
Mark, here it is: files: "$(sys.workdir)/promise.log" file_select => size_exceeds("1M"), rename => rotate("2"), depth_search=> recurse("1"), comment => "rotate promise.log"; Now I've commented out d

Re: rename => rotate and depth_search => recursion

2010-06-04 Thread Mark Burgess
Hi Seva, this sounds pretty silly, so I'm going to blame someone else for this ;-) Can you show the original promise that generated the error please? Seva Gluschenko wrote: > Hello folks, > > When I wrote a promise to rotate /var/cfengine/promise.log (BTW, why > Cfengine doesn't rotate it?), cf

rename => rotate and depth_search => recursion

2010-06-03 Thread Seva Gluschenko
Hello folks, When I wrote a promise to rotate /var/cfengine/promise.log (BTW, why Cfengine doesn't rotate it?), cf-promises warned me about using rename body without depth_search body. Well, okay, despite I was surprised with such a requirement, I've added depth_search => recursion("1"). Now (with