Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://wiki.cmc.msu.ru/System/SiteToolStatistics?cover=print;rev=1
Дата изменения: Unknown Дата индексирования: Mon Apr 11 18:17:09 2016 Кодировка: |
%STATISTICSTOPIC%
cron
job
CHANGE
permission on the WebStatistics topic. Statistics generation can create a significant workload on the server. In order to further restrict statistics generation:
statistics
to the {AuthScripts}
list (This is now the default on Foswiki 1.1.4). This is required to prevent unauthenticated guest users from running statistics
. {Stats}{StatisticsGroup}
to the group permitted to run statistics. bin/statistics
script from a cron job, once a day is recommended. This will update the WebStatistics topics in all top level webs. (Sub-webs are not processed by default).
nobody
on many systems.
0 0 * * * (cd /path/to/bin; ./statistics >/dev/null 2>&1)
There is a workaround in case you can't run the script as the CGI user. Use the. When running from the command line or a cron job, you can pass parameters to the script like this:curl
orwget
tools available on most distributions. These two examples perform the same function using curl and wget in the crontab. You should only use one of them.0 0 * * * (curl -F webs=Sandbox -F subwebs=1 your.host.com/bin/statistics >/dev/null 2>&1) 0 0 * * * (wget --post-data 'webs=Sandbox&subwebs=1' -O - your.host.com/bin/statistics >dev/null 2>&1)Bothcurl
andwget
can performhttp
authentication, and can log in if you are using Apache login. See the platform documentation forwget
orcurl
for more information. If using Template login, authentication will not be possible, and the CGI request will run as the WikiGuest user. If you use this workaround, the WebStatistics topics you are updating will have to be writable by WikiGuest, and you cannot addstatistics
to the{AuthScripts}
list If you do not havecurl
orwget
available on your platform, Foswiki provides a very simple script that can post to or get from a web server. It has no authentication capabilities. Deprecated! This script is deprecated and may be removed in a future release.
Run the utilitytools/geturl.pl
in your cron job and specify the URL of thebin/statistics
script as a parameter as shown here:0 0 * * * (cd /path/to/tools; ./geturl.pl POST mydomain.com /urlpath/to/bin/statistics?webs=Sandbox\;subwebs=1 >/dev/null 2>&1)
./statistics -logdate 200605 -webs Userweb,Sandbox -autocreate 1 -subwebs 1
Parameter | Usage | Default |
---|---|---|
-logdate |
Specify date of logfile in YYYYDD format. | Current logfile |
-webs |
Comma separated list of webs | All top level webs |
-autocreate |
1 to enable inclusion of subwebs | disabled . Subwebs must be explicitly listed in -webs to be processed. |
bin/statistics
script can automatically create the required topics when enabled in the configuration, or when requested by URL Parameter autocreate=1
.
{Stats}{AutoCreateTopic}
to Always
{Stats}{AutoCreateTopic}
to Permitted
statistics
on one or more webs.
-autocreate 1
to the statistics script as shown above.
{Stats}{AutoCreateTopic}
to Prohibited
bin/statistics
script can also be executed as a CGI script, Use the form at the top of this topic to run statistics.
As of Foswiki 1.1.5, the statistics script must be run using the "post" method. Direct entry of a URL is no longer allowed.
{Stats}{AutoCreateTopic}
is enabled in the configuration, or the autocreate
parameter is passed to the statistics
script, then a new WebStatistics is created using the WebStatisticsTemplate topic found in the first step. autocreate
is not requested, and the WebStatistics topic does not exist, then statistics will not be computed for the web.
%INCLUDE%
for help text and table headings, and a critical marker line
that defines the columns to be recorded by the statistics script. (This allows the help text or headings to be modified without needing to edit every WebStatistics topic.) marker line
is found in the topic, statistics are inserted into the topic after the marker line
.
marker line
is present, but the topic contains existing statistics, the current month is update, or a new month is written after the previous month.
marker line
is present and no previous statistics exist, a new line is added to the end of the topic.
Removal of the marker line causes statistics to be gathered in chronological order (oldest first). By default, statistics are reported in reverse chronological order.
Themarker line
defines the order of the columns collected by the statistics
script. The order of the columns should correspond to the table heading in the DefaultWebStatistics. Default marker line is:
| <!--statDate--> | <!--statViews--> | <!--statSaves--> | <!--statUploads--> | <!--statTopViews--> | <!--statTopContributors--> |
* Set DENYTOPICVIEW = WikiGuest
For existing WebStatistics topics you will need to write these settings manually.
{Stats}{AutoCreateTopic}
or add -autocreate 1
to the cron job that runs the statistics script.
WebStatisticsYYYY
at year end.
%SEARCH{"." type="regex" topic="%STATISTICSTOPIC%*" excludetopic="%BASETOPIC%" scope="topic" nonoise="on" header="*Other Statistics Topics:*" format=" * $web.$topic"}%Following these steps will start a fresh statistics topic with a clean revision history.