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

3220Re: [webalizer] Problem with running webalizer as cron job

Expand Messages
  • Dave Patton [DCP]
    Apr 27 2:10 PM
    • 0 Attachment
      Vahagn Avedian wrote:
      > So, I can't run webalizer as a cron job? To be honest, didn't catch
      > the hint about how to fix the problem.

      > "Bradford L. Barrett" <brad@...> wrote:
      >
      >> I worked around the problem we had with webalizer and put it in the
      >> cron job queue. But while it works fine when I run it in from the
      >> shell line, the cron job execution fails due to:
      >>
      >> Webalizer V2.01-10 (FreeBSD 4.8-STABLE) English Using logfile STDIN
      >> (clf)
      >
      > ^^^^^^^^^^^^^^^^^^^
      >
      > You cannot use STDIN as input when run from cron unless you take
      > special care to pipe input to it (not recommended).

      You can run webalizer from a shell script that is
      run as a cron job.

      Bradford was pointing out that the error message
      you included indicates that your cron job is setup
      so that webalizer is looking for the logfile data
      on STDIN.

      In other words, you have setup your cron job incorrectly.
      Here's an example of the type of shell script I use:
      ----------------------------------------------------
      #!/bin/sh

      # script for cron job
      # generates public webstats
      # runs every day at 04:00 AM Eastern US Time

      # run from Webalizer directory
      cd /path/to/webalizer

      # Logs are BZip compressed
      # yesterdayslog.pl is a Perl script that generates
      # the correct name for the logfile for "yesterday"
      # Yesterday's log is named mylog.YYYYMMDD.bz2
      bzcat /logs/`perl ~/yesterdayslog.pl` | ./webalizer -q -c dcp.conf

      # example of processing a log
      # cd /path/to/webalizer
      # bzcat /logs/mylog.20050426.bz2 | ./webalizer -q -c dcp.conf
      ----------------------------------------------------


      --
      Dave Patton
      Canadian Coordinator, Degree Confluence Project
      http://www.confluence.org/
      My website: http://members.shaw.ca/davepatton/
    • Show all 8 messages in this topic