Loading ...
Sorry, an error occurred while loading the content.

Configuring to work with logrotate

Expand Messages
  • ricurtis2003
    Hi all, I am a bit confused as to the best way to run webalizer in conjunction with logrotate. At present, I dont use logrotate on the web servers logs (It is
    Message 1 of 5 , Nov 9, 2004
    • 0 Attachment
      Hi all,
      I am a bit confused as to the best way to run webalizer in
      conjunction with logrotate.

      At present, I dont use logrotate on the web servers logs (It is
      Redhat 9 with apache2). The current crontab entry is:
      00 4 * * * /usr/local/bin/webalizer -c /home/site078/logs/078.conf

      which correctly rebuilds the webalizer stats nightly at 4.00am

      I now have to implement logrotate to rotate stats monthly.
      What is the best way to work with webalizer ?
      Should I get it to run monthly (*after* the logrotate) and analyse
      the previous months logs ? I understand that this way the stats for
      the month are only available at the end of the month.
      If I do this, should I have anything specific in my logrotate conf
      (in this case 078.conf)

      Or should I do it in a different way... can anyone else using
      webalizer in conjunction with logrotate offer any insight into how
      they do it.

      Thanks

      Rich
    • Dave Patton [DCP]
      ... The host for the confluence.org website provides daily weblogs, with a maximum retention of 7 days. There have been occasional problems where one, or a
      Message 2 of 5 , Nov 9, 2004
      • 0 Attachment
        ricurtis2003 wrote:
        >
        > Hi all,
        > I am a bit confused as to the best way to run webalizer in
        > conjunction with logrotate.
        >
        > At present, I dont use logrotate on the web servers logs (It is
        > Redhat 9 with apache2). The current crontab entry is:
        > 00 4 * * * /usr/local/bin/webalizer -c /home/site078/logs/078.conf
        >
        > which correctly rebuilds the webalizer stats nightly at 4.00am
        >
        > I now have to implement logrotate to rotate stats monthly.
        > What is the best way to work with webalizer ?
        > Should I get it to run monthly (*after* the logrotate) and analyse
        > the previous months logs ? I understand that this way the stats for
        > the month are only available at the end of the month.

        The host for the confluence.org website provides daily
        weblogs, with a maximum retention of 7 days. There have been
        occasional problems where one, or a series, of logs have
        been missing, so when the cron job runs, it shows zero
        stats for those days, or else a very low number, if the
        log rotation doesn't happen such that the log entries
        start/stop exactly at midnight.

        This causes problems if you want complete stats for the
        month, because manually running webalizer on the missing
        logs after they are restored doesn't work, because the
        incremental processing ignores them, because it already
        has stats for those days(even though they are zero).
        Furthermore, to anticipate such problems, you have to
        store the daily logs for the entire month, in case there
        is a problem, because you then, at month's end, have to
        process all the daily logs for the month, one at a time,
        in order, after you manually delete some of the existing
        webalizer files, and edit others.

        We can't change our setup, but if we could, I'd ask for
        a monthly log, and I'd setup a script to process it on
        the first of the next month.

        --
        Dave Patton
        Canadian Coordinator, Degree Confluence Project
        http://www.confluence.org/
        My website: http://members.shaw.ca/davepatton/
      • Bradford L. Barrett
        ... Why use logrotate if you don t need to?!? :) Just setup a monthly script to rotate the log at midnight (EOM) and process the rotated log. Nothing else as
        Message 3 of 5 , Nov 9, 2004
        • 0 Attachment
          > Hi all,
          > I am a bit confused as to the best way to run webalizer in
          > conjunction with logrotate.

          Why use logrotate if you don't need to?!? :)
          Just setup a monthly script to rotate the log at midnight (EOM) and
          process the rotated log. Nothing else as far as daily processing
          needs to change. There is an example in the README file.

          You can also expand the script to rotate the log, process it with
          the webalizer, compress it via gzip or similar, move it out of the
          way to an archive directory and then scan the archive directory to
          see if any old archived logs need to be removed to save disk space.

          --
          Bradford L. Barrett brad@...
          A free electron in a sea of neutrons DoD#1750 KD4NAW

          The only thing Micro$oft has done for society, is make people
          believe that computers are inherently unreliable.
        • Dave Patton [DCP]
          ... Note that what really matters is the logfile content, not so much when the log rotation is done. In other words, what you want is all of one month s
          Message 4 of 5 , Nov 9, 2004
          • 0 Attachment
            Bradford L. Barrett wrote:
            >
            >>Hi all,
            >> I am a bit confused as to the best way to run webalizer in
            >>conjunction with logrotate.
            >
            >
            > Why use logrotate if you don't need to?!? :)
            > Just setup a monthly script to rotate the log at midnight (EOM) and
            > process the rotated log.

            Note that what really matters is the logfile content,
            not so much when the 'log rotation' is done. In other
            words, what you want is all of one month's logfile records
            in one file, based on the timestamps in the logfile records.
            That may not happen just because you 'run a script at midnight'.

            --
            Dave Patton
            Canadian Coordinator, Degree Confluence Project
            http://www.confluence.org/
            My website: http://members.shaw.ca/davepatton/
          • ricurtis2003
            ... I was looking into logrotate as it is a prebuilt app specifically for log rotation. I dont see the point in reinventing the wheel. I am sure that
            Message 5 of 5 , Nov 10, 2004
            • 0 Attachment
              >
              > > Hi all,
              > > I am a bit confused as to the best way to run webalizer in
              > > conjunction with logrotate.
              >
              > Why use logrotate if you don't need to?!? :)
              > Just setup a monthly script to rotate the log at midnight (EOM) and
              > process the rotated log. Nothing else as far as daily processing
              > needs to change. There is an example in the README file.
              >
              > You can also expand the script to rotate the log, process it with
              > the webalizer, compress it via gzip or similar, move it out of the
              > way to an archive directory and then scan the archive directory to
              > see if any old archived logs need to be removed to save disk space.

              I was looking into logrotate as it is a prebuilt app specifically
              for log rotation. I dont see the point in reinventing the wheel. I
              am sure that logrotate would be better than any script I can come up
              with anyway.

              Am I missing something here ?

              Anyway, thanks for the replies.... I now know what I need to do.

              Thanks all
              Rich
            Your message has been successfully submitted and would be delivered to recipients shortly.