Learn about Centmin Mod LEMP Stack today
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

    44,477
    10,164
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,726
    Local Time:
    9:10 AM
    Nginx 1.17.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

    92
    19
    8
    Sep 16, 2017
    Ratings:
    +25
    Local Time:
    4:40 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

    92
    19
    8
    Sep 16, 2017
    Ratings:
    +25
    Local Time:
    4:40 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

    44,477
    10,164
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,726
    Local Time:
    9:10 AM
    Nginx 1.17.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 ?