Force awstats to generate stats

Discussion in 'Installation/Configuration' started by luckyluk3, Jan 23, 2019.

  1. luckyluk3

    luckyluk3 New Member

    I was looking for a way to force awstats to generate the reports into the stats folder of websites. Some posts I found wrote that I needed to enter this command `/usr/local/ispconfig/server/cron.sh`. I ran the script but the awstats I wanted didn't generate.

    After some time on google I found this command `php cron_debug.php --cronjob=150-awstats.inc.php`. It worked!!, it generated the awstats files I wanted. Now is my question: why does the php command work and the cron.sh doesn't? Am I missing something or is this the way it should work? This is my first ispconfig installation it has only been running for a couple of hours, the nightly script hasn't ran yet.

    Linux Distribution: Debian GNU/Linux 9 (stretch)
    ISPConfig version: 3.1.13

    https://www.howtoforge.com/community/threads/force-update-of-awstats.62384/
    https://www.howtoforge.com/community/threads/awstats-not-working.80724/
     
  2. Jesse Norell

    Jesse Norell Well-Known Member

    ISPConfig cronjobs run on a schedule, just like regular system cron, and that one is scheduled to run at midnight:
    Code:
    # grep 'schedule =' /usr/local/ispconfig/server/lib/classes/cron.d/150-awstats.inc.php
            protected $_schedule = '0 0 * * *';
    
    You of course ran it manually, bypassing the scheduled time.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Statistics are generated nightly, so when you run cron.sh at a time where stats shall not be generated, then it will not generate the statistics. the cron debug plugin is a dev tool, it overrides the time settings of the cronjobs for development purposes, that's why it generates the statistics no matter when you run it. So everything works at it should be on your system.
     
  4. luckyluk3

    luckyluk3 New Member

    Thanks for your quick response, that does indeed make sense. I just couldn't wait until midnight to see results :D. Thanks again!!
     
  5. luckyluk3

    luckyluk3 New Member

    @till Hello, I changed this line in the `150-awstats.inc.php`file.
    Code:
    //protected $_schedule = '0 0 * * *';
    protected $_schedule = '*/5 * * * *';
    Hoping that it would run every 5 minutes, but that doesn't seem to work. Do I have to update it somewhere else. Also running one of the below commands didn't trigger it to run.
    Code:
    /usr/local/ispconfig/server/server.sh
    /usr/local/ispconfig/server/cron.sh
    /usr/local/ispconfig/server/scripts/create_daily_nginx_access_logs.sh
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    It will start doing this after the next nightly run. I won't run that script every 5 minutes.
     
  7. luckyluk3

    luckyluk3 New Member

    Ah yes I understand, it was just for testing.
    Is there any way to force that nightly run manually with 1 or multiple commands or are there to many strings attached when doing that?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    If you want to run it manually, use the cron_debug script. But all these scripts are made to be run once a day, so running them more often might work but it also might be that you get side effects like wrong traffic stats or logs rotated every time you run it instead of once a day. If you want to have realtime stats for a website, better use Matomo or google analytics with a js include in your site.
     
  9. luckyluk3

    luckyluk3 New Member

    Okay thank you. And thanks for the Matomo suggestion didn't know about it.
     

Share This Page