awstats.pl called by "cronjob" from webfrontend fails
This almost drove me mad today. i was working on a webserver from Domainfactory and wanted to have a cronjob which should call
awstats.pl -config=www.domain.com -update
Unfortunately you cannot create cronjobs from shell but have to use their tool from the webfrontend to set up cronjobs. what happened is, that the cronjob never executed awstats.pl because awstats.pl reported all the time:
Did you use the correct URL ?
because it could not find the conf.file. however, the conf-file was there
The reason was, that this "cronjob" was actually some script from Domainfactory which was called by the webserver,and it set the Enviroment Variable "GATEWAY_INTERFACE" to
But if awstats.pl finds this variable, it thinks it is called by a browser:
The solution is to let this "cronjob" call some other script which before it calls awstats.pl empties the env value:
suddenly it started working.
drove me mad for 2 hours!