I am trying to use logrotate to rotate our web logs for our various vhosted sites to cut down on space and rotate out old logs that are not necessary to keep around personally. What Im curious to find out, is how supported extended regular expressions is within the logrotate.conf file. More specifically, will logrotate be smart enough to decipher the following: /path/to/logs/access_log.www.*.(com|org|net|us) The filename format for my logs are: access_log.www.domain.com/net/org/us. Thank you in advance. Sol -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20090923/c7409a07/attachment.html>
On Wed, Sep 23, 2009 at 11:33:32AM -0400, Sol Fulop wrote:> I am trying to use logrotate to rotate our web logs for our various > vhosted sites to cut down on space and rotate out old logs that are not > necessary to keep around personally. What Im curious to find out, is > how supported extended regular expressions is within the logrotate.conf > file. More specifically, will logrotate be smart enough to decipher the > following: > > /path/to/logs/access_log.www.*.(com|org|net|us)AFAIK, logrotate doesn't support regular expressions, only wildcards (* and ?). -- lfr 0/0 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20090923/8a27dc3c/attachment.sig>
Is there a way around that??? Like run a command to get all the filenames then pipe it to the config directive /path/to/logs/access_log.www.*.(com|org|net|us) {} in logrotate.conf? Sol -----Original Message----- From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On Behalf Of Luciano Rocha Sent: Wednesday, September 23, 2009 11:39 AM To: CentOS mailing list Subject: Re: [CentOS] logrotate and regular expressions On Wed, Sep 23, 2009 at 11:33:32AM -0400, Sol Fulop wrote:> I am trying to use logrotate to rotate our web logs for our various > vhosted sites to cut down on space and rotate out old logs that are > not necessary to keep around personally. What Im curious to find out,> is how supported extended regular expressions is within the > logrotate.conf file. More specifically, will logrotate be smart > enough to decipher the > following: > > /path/to/logs/access_log.www.*.(com|org|net|us)AFAIK, logrotate doesn't support regular expressions, only wildcards (* and ?). -- lfr 0/0
Frank.Brodbeck at klingel.de
2009-Sep-24 07:33 UTC
[CentOS] Antwort: logrotate and regular expressions
Hi, "Sol Fulop" <sfulop at core101.com> schrieb am 23.09.2009 17:33:32:> I am trying to use logrotate to rotate our web logs for our various > vhosted sites to cut down on space and rotate out old logs that are > not necessary to keep around personally. What Im curious to find > out, is how supported extended regular expressions is within the > logrotate.conf file.Ok... logrotate(8) is unpleasantly unspecific about that, though from googling [1], and reading glob(3) I believe that globbing is available through (g)libc which logrotate is linked to: # ldd /usr/sbin/logrotate libpopt.so.0 => /usr/lib64/libpopt.so.0 (0x0000003c8c000000) libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003c88000000) libc.so.6 => /lib64/libc.so.6 (0x0000003c86800000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003c87000000) libsepol.so.1 => /lib64/libsepol.so.1 (0x0000003c87c00000) /lib64/ld-linux-x86-64.so.2 (0x0000003c86400000) So I guess you can use glob(7) (as stated in [1]). Frank. [1] http://www.mail-archive.com/kplug-list at kernel-panic.org/msg10293.html