I use Nginx as a proxy for my dotnet core application and with that I wanted to get some reporting so I installed GoAccess, which generates a nice HTML report.
Set this up in your root crontab via a “crontab -e” as root:
0 * * * * /bin/bash /opt/generate_report.sh ~
Note the extra blank line, you will go crazy trying to get this to work if you don’t add the blank line at the end.
Then edit your generate_report.sh file like this:
#!/bin/sh /usr/bin/zcat -f /var/log/nginx/*.log* | /usr/bin/goaccess --log-format=COMBINED -o /var/www/logreport.html -
Note the extra “-” at the end of the command line without it the cron execute does not work.
Enjoy!