Carl Lowenstein wrote:
> On 6/20/06, John Oliver <[EMAIL PROTECTED]> wrote:
>> On Mon, Jun 19, 2006 at 07:05:59PM -0700, Carl Lowenstein wrote:
>> > On 6/19/06, John Oliver <[EMAIL PROTECTED]> wrote:
>> > >I just moved some web server logs around.  For now, I want them to be
>> > >rotated monthly instead of weekly like the rest.  In
>> > >/etc/logrotate.d/httpd I put:
>> > >
>> > >/var/log/httpd/[!content.flashadengine.com]*log
>> > >
>> > >Is that going to do what I think it'll do? :-)  I just want to be sure
>> > >that logrotate isn't one of those things that's an exception, that
>> > >there isn't some different way it understands :-)
>> >
>> > I suppose it would help if you told us what you think it will do.  And
>> > what are the names of the files that normally reside in
>> > /var/log/hppd/.
>>
>> I thought that would be pretty clear... to rotate everything in
>> /var/log/httpd/ except files that start with content.flashadengine.com
>>
>> Maybe I'm further off base than I thought :-)
> 
> As far as I can tell, logrotate uses shell wild cards not regular
> expressions.  So to simplify your example,
>      [!flash]*.log
> would refer to any file name that did not begin with "f", "l", "a",
> "s", "h" and ended with .log
> This is certainly not what you were trying for.

Well, bash has extended globbing features available with (shopt -s
extglob) -- do 'man bash' and search for extglob

..BUT..

 1) it's not clear (to me, anyway) whether logrotate uses/honors bash
globbing, or  follows some other homegrown method
 2) even it if works, depending on extglob features reduces
portability/readability/maintainability -- you'd at least want to
document it carefully
 3a) it just looks awkward and ugly -- I'd be inclined to look for
another way, even if I had to substitute some other cron operation for
logrotate
 3b) maybe multiple entries of each _desired_ file/pattern, and just
omit the flash-pattern

..jim

> 
> I asked about the names of the other files to see if there was a
> possibility of wild-card inclusion rather than exclusion.
> 
> Can you put the log files that you want to treat differently into a
> directory of their own?
> 
>    carl


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to