Search for:

  • Article for your preferred language does not exist. Below is international version of the article.
Available article translations:

[HOWTO] How do I recalculate AWstats statistics from logs for previous months?

Article ID: 115476, created on Jan 30, 2013, last review on Jan 26, 2015

  • Parallels Plesk for Linux/Unix

Usage instructions

Run the following commands to download, unzip, make executable, and execute the script on your server:

    # wget
    # unzip
    # chmod u+x
    # ./

If no arguments are supplied, the script will display "Help". See more information on how the script works below.


For each specified domain (or all domains if the -A option is used), the script will learn the log files' start date. Then, it will remove the AWstats data files for the months covered by the log file and rebuild them with information from the logs. Finally, the script builds static pages with a statistics summary for each month covered by the log files.

Alternatively, if the -F option is used, all data files are removed and new files are generated using information from the log files.


# ./

Rebuild AWstats static pages from available log files.

Usage: ./ [options] [<domains...>]

        Process all domains. If this option is not specified, then list of
        domains to process must be provided.

        Remove contents of webstat/ and webstat-ssl/ directories before
        rebuilding statistics pages (originals are saved with numeric
        suffix). Statistics will be rebuilt from logs only, only for
        period covered by log files. If this parameter is not used, then
        statistics is recalculated beginning on the month on which log files
        start (if log starts in the middle of the month, then statistics
        for first half of the month will not be present.)

        This message.

Home page: <>

Example output

For each processed domain, the script reports the following:

Saving: webstat* --> webstat*.9
Logs begin on Oct 27 2012
access_log* (new/old/corrupted): 9/0/0
access_ssl_log* (new/old/corrupted): 71/0/0
Rebuilding static pages: 2012-10 2012-11 2012-12 2013-01 2013-02

As you can see, the original directories are saved with a numeric suffix (the suffix is increased if the destination directory already exists). As a result, it is possible to roll-back to a previous version if required.

Known issues:

#117731 script fails with error: "ERROR: failed to merge access_log"

Search words:

statistics not showing

awstats show more page views than actual clients

awstats aktualisiert nicht mehr

The system cannot find the file specified. (Error code 2) at CreateProcess

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=b

awstat not calculating statistics for last months

recalculate webstatistics

domain statistics awstats not similar

recalculate AWstats

prmpt password

awstats and domain stats are not in sync


How to

Web statistics won't work

sqlstate can't create/write file

Web-statistics in Plesk

problema http traffic statistic

404 Not Found AWStats Plesk 12

Statistics not found

awstats and domain stats are not in sync'

incorrect stats for the last day of the month

Webstatistic don´t show any Visitors in a month

Unable to parse pending domains traffic line

statistics wrong calculated with plesk 11.5

incorrect stats



awstats not working


56797cefb1efc9130f7c48a7d1db0f0c c81e59b61af9dca603ba03b14aabe968 9f8baf78266b4e54525d1c6bf06305a5

Was this article helpful?
Tell us how we may improve it.
Yes No
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0
- Parallels Virtuozzo Containers
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification