Как изменить конфигурацию AWSTATS с помощью cli

В моих файлах журнала Apache есть дата, указанная в имени, и я не могу это изменить. Есть ли способ изменить параметр конфигурации LogFile для AWSTATS с помощью командной строки Windows CMD? А еще лучше пакетный скрипт? Конечно, я могу попытаться найти и заменить то, что мне нужно, но я не был уверен, есть ли в AWSTATS простая команда CLI, подобная этой:

awstats.pl -config LogFile = "C: \ path \ to \ log \ file "

Я собираюсь написать пакетный сценарий, который изменит параметр, а затем обновит базу данных AWSTATS во время обработки в конце дня.

0
задан 20 November 2015 в 19:52
1 ответ

Итак, я понял, что AWSTATS предоставляет теги, которые можно использовать для динамического представления даты, что означает, что вам не нужно вручную изменять дату каждый день (будь то с помощью пользовательского кода или на самом деле меняя путь LogFile каждый день).

# "LogFile" contains the web, ftp or mail server log file to analyze.
# Possible values: A full path, or a relative path from awstats.pl directory.
# Example: "/var/log/apache/access.log"
# Example: "../logs/mycombinedlog.log"
# You can also use tags in this filename if you need a dynamic file name
# depending on date or time (Replacement is made by AWStats at the beginning
# of its execution). This is available tags :
#   %YYYY-n  is replaced with 4 digits year we were n hours ago
#   %YY-n    is replaced with 2 digits year we were n hours ago
#   %MM-n    is replaced with 2 digits month we were n hours ago
#   %MO-n    is replaced with 3 letters month we were n hours ago
#   %DD-n    is replaced with day we were n hours ago
#   %HH-n    is replaced with hour we were n hours ago
#   %NS-n    is replaced with number of seconds at 00:00 since 1970
#   %WM-n    is replaced with the week number in month (1-5)
#   %Wm-n    is replaced with the week number in month (0-4)
#   %WY-n    is replaced with the week number in year (01-52)
#   %Wy-n    is replaced with the week number in year (00-51)
#   %DW-n    is replaced with the day number in week (1-7, 1=sunday)
#                              use n=24 if you need (1-7, 1=monday)
#   %Dw-n    is replaced with the day number in week (0-6, 0=sunday)
#                              use n=24 if you need (0-6, 0=monday)
#   Use 0 for n if you need current year, month, day, hour...
# Example: "/var/log/access_log.%YYYY-0%MM-0%DD-0.log"
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
# You can also use a pipe if log file come from a pipe :
# Example: "gzip -cd /var/log/apache/access.log.gz |"
# If there are several log files from load balancing servers :
# Example: "/pathtotools/logresolvemerge.pl *.log |"
0
ответ дан 5 December 2019 в 11:33

Теги

Похожие вопросы