How to recalculate statistics in Plesk

Plesk-LogoPlesk recalculates all usage statistics once every day as part of a daily maintenance script. Sometimes however you’ve made a change and would like to see statistics updated immediately rather than “sometime tomorrow”.

The solution: run the statistics recalculations script manually.

On CentOS the path to the file is /usr/local/psa/admin/sbin/statistics. When used on its own all statistics are recalculated on the spot.

You can use the script with options too, for example to update a single domain only. Use the –help switch to see the full array of options:

/usr/local/psa/admin/sbin/statistics --help

Usage: /usr/local/psa/admin/sbin/statistics [ options ]

--calculate-all               Calculate statistics for all domains
--calculate-one               Calculate statistics for <domain-name>
--domain-name|-d <string>     
--calculate-list              Calculate statistics for listed domains
--generate-all-webstat        Generate web-statistics pages for all domains
--generate-domain-webstat     Generate web-statistics pages for <domain-name>
--domain-names|-n <string>    List of domains, comma separated
--domain-ids|-i <string>      List of domains IDs, comma separated
--process-domains|-p <string> Calculate statistics for <domain-name>
--all                         Calculate all aspects of statistics
--antivirus                   Calculate antivirus and antispam statistics
--no-webstat                  Do not generate web-statistics pages (always set for PPA mode or Windows)
--help|-h                     display this help and exit

If no options specified - calculate statistics for all domains

Depending on the amount of domains you have this can take a minute or two. If you’re only interested in refreshing statistics for a single domain you can use this syntax:

/usr/local/psa/admin/sbin/statistics --calculate-one -d

Have fun ;-)

You can leave a comment on my original post.