On 6/20/06, James G. Sack (jim) <[EMAIL PROTECTED]> wrote:
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

More information.  I just downloaded the source of logrotate and built
it.  From that I learned that it is linked with the routine described
in glob(3) which uses patterns described in glob(7).  No extended BASH
globbing.

For more than you really wanted to know, exercise your system with
command  "man 7 glob"
Pay attention, because it tells you in no uncertain terms that shell
glob patterns are not regular expressions, and vice versa.

   carl
--
   carl lowenstein         marine physical lab     u.c. san diego
                                                [EMAIL PROTECTED]


--
KPLUG-List@kernel-panic.org
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to