Want to subscribe to topics you're interested in?
Become a Member

Featured Sysadmin GoAccess open source real time web log analyzer

Discussion in 'System Administration' started by eva2000, Jun 5, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    45,640
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,071
    Local Time:
    9:51 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    what does cron-goaccess.sh contain ? also for code you may want to use CODE tags for perserving formatting
     
  2. Dnyan

    Dnyan Member

    97
    20
    8
    Sep 16, 2017
    Ratings:
    +28
    Local Time:
    5:21 AM
    1.17.8
    10.3.22
    it contains

    HTML:
    #!/bin/sh
    echo "start"
    now=$(date +"%T")
    echo "Current time : $now"
    
    /usr/bin/zcat -f /home/nginx/domains/mydomain.com/log/access.log* | goaccess -p /etc/goaccess.conf -a > /home/nginx/domains/mydomain.com/public/my_report.html
    echo "finish"
    
     
  3. Dnyan

    Dnyan Member

    97
    20
    8
    Sep 16, 2017
    Ratings:
    +28
    Local Time:
    5:21 AM
    1.17.8
    10.3.22
    Finally made it workable by adding following in crontab

    Code:
    0 * * * * /bin/zcat -f /home/nginx/domains/mydomain.com/log/access.log* | /usr/local/bin/goaccess -a -o /home/nginx/domains/mydomain.com/public/my_report.html -
    a space and dash at the end of the cron is added purposefully to make it work.

    this cron runs every hour at 0 minutes.
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,640
    10,356
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,071
    Local Time:
    9:51 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    space and dash shouldn't be needed. I think using full path to goaccess is what made it work ?