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/
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.
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.
Thanks for your quick response, that does indeed make sense. I just couldn't wait until midnight to see results . Thanks again!!
@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
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?
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.