Opened 8 months ago

Closed 7 months ago

#13769 closed Feature/Enhancement Request (fixed)

AWStats reliability improvement suggestion

Reported by: Owned by:
Priority: Medium Component: Tech
Keywords: awstats statistics log cron Cc:
Sensitive: no

Description (last modified by

Hi all,

I ran into a situation with a poorly scheduled awstats run. Basically, the situation is this: if the awstats script to generate everything is run close enough to the end of the hour, when it finishes log parsing and begins the report page generation, when a month/year is not supplied, it will skip to processing the subsequent - at the time current - month. For example, our report that ended up in the 201801 folder contained the report for the very beginning of Feb 1 2018 only. If the month/year is added to the call to awstats, this can be avoided.

In order to be able to schedule it effectively, I would suggest a changes such as the following:

< date=`date +%Y%m`
> date=`date --date="-1 hour"`
> year=`date --date="$date" +%Y`
> month=`date --date="$date" +%m`
> ym=$year$month
< if [ ! -d $dir/$date ]; then
<         mkdir $dir/$date;
> if [ ! -d $dir/$ym ]; then
>         mkdir $dir/$ym;
< /usr/share/awstats/tools/ -config=$config -update -awstatsprog=/usr/lib/cgi-bin/ -dir=$dir/$date/ -configdir=/etc/awstats
> /usr/share/awstats/tools/ -config=$config -update -awstatsprog=/usr/lib/cgi-bin/ -dir=$dir/$ym/ -configdir=/etc/awstats -month=$month -year=$year

This way we should be good to run at the turn of the hour and nothing at the end of a month would be missed.

Edited to correct doubled-dash to single dash for date params.

Attachments (1)

mf-awstats-build-staticpages (971 bytes) - added by 8 months ago.
Updated mf-awstats-build-staticpages

Download all attachments as: .zip

Change History (7)

Changed 8 months ago by

Updated mf-awstats-build-staticpages

comment:1 Changed 8 months ago by

  • Description modified (diff)

comment:2 Changed 8 months ago by

  • Owner set to
  • Status changed from new to assigned

comment:3 Changed 8 months ago by

Awesome! Thank you wolcen - I just pushed the change to our puppet repo.

Which server are you testing on? I'd like to push the changes to your server so you can confirm that things are still working well before pushing out everywhere.

comment:4 Changed 7 months ago by

Hi Jamie - sorry for the delay, was out on a short break.

We've been working on portside's stats (newportside on mumia).


comment:5 Changed 7 months ago by

Excellent - the changes are in place on mumia. Let us know if I got it right :)

comment:6 Changed 7 months ago by

  • Resolution set to fixed
  • Status changed from assigned to closed

The June statistics just updated as expected. Nice :)

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.