Логи ротируются раз в неделю. SARG запускается без параметров, он берет по дефолту access.log и даты отчета будут с с даты самой первой записи по самую последнюю.
Чтобы получить отчет за какой-то определенный день, нобходимо запустить так:
/bin/sarg -d 11/09/2016 > / dev / null 2> & 1
/bin/sarg -d 12/09/2016 > / dev / null 2> & 1
и т.д.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Спасибо за ответ!
А ротация логов это настройка sarg или системы?
Не подскажете тогда, как поступить, вернее настроить cron, чтобы отчеты за прошлые дни были вида:
11/09/2016-11/09/2016
12/09/2016-12/09/2016
....
Но при этом за текущий день также отчет создавался каждый час.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't understand Evgeniy's answer and I may not be the only one :-) so, to spare anyone interested in the answer a trip to Google translation, I'll repeat it in English.
When sarg is executed without arguments (as you do), it generates a report containing the full access.log. The report is named after the dates found in the log.
As the access.log grows, more days are added to the log. Therefore, sarg sees an access.log covering more days and it adjusts the report name accordingly.
To generate a report covering only the current day, run sarg like this:
/bin/sarg -d day-0
But I recommend you run sarg only once per day, during the morning, to generate yesterday's report like this:
01***root/bin/sarg-dday-1>/dev/null2>&1
It will spare the CPU and disk, especially if the log is big. The report will contain only one day worth of data and no entry will be missing (as compared to running sarg -d day-0 and missing any entry added to the log after sarg was run for the last time that day).
Good afternoon.
Could you tell why the report shows that it was done at 11 pm, when cron executes the task at 01:00?
0 1 * * root / bin / sarg -d day-1> / dev / null 2> & 1!
Last edit: Aleksey 2016-09-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good afternoon.
Established sarg 2.3.10 on Centos 6.8. The program works and reports on a schedule:

0 * / 1 * * * root / bin / sarg> / dev / null 2> & 1
Why reports are created in such a range?
11/09/2016-12/09/2016
11/09/2016-13/09/2016
11/09/2016-14/09/2016
11/09/2016-15/09/2016
Логи ротируются раз в неделю. SARG запускается без параметров, он берет по дефолту access.log и даты отчета будут с с даты самой первой записи по самую последнюю.
Чтобы получить отчет за какой-то определенный день, нобходимо запустить так:
/bin/sarg -d 11/09/2016 > / dev / null 2> & 1
/bin/sarg -d 12/09/2016 > / dev / null 2> & 1
и т.д.
Спасибо за ответ!
А ротация логов это настройка sarg или системы?
Не подскажете тогда, как поступить, вернее настроить cron, чтобы отчеты за прошлые дни были вида:
11/09/2016-11/09/2016
12/09/2016-12/09/2016
....
Но при этом за текущий день также отчет создавался каждый час.
I don't understand Evgeniy's answer and I may not be the only one :-) so, to spare anyone interested in the answer a trip to Google translation, I'll repeat it in English.
When sarg is executed without arguments (as you do), it generates a report containing the full access.log. The report is named after the dates found in the log.
As the access.log grows, more days are added to the log. Therefore, sarg sees an access.log covering more days and it adjusts the report name accordingly.
To generate a report covering only the current day, run sarg like this:
But I recommend you run sarg only once per day, during the morning, to generate yesterday's report like this:
It will spare the CPU and disk, especially if the log is big. The report will contain only one day worth of data and no entry will be missing (as compared to running
sarg -d day-0and missing any entry added to the log after sarg was run for the last time that day).As your log appears to be rotated away, make sure you follow the advice in [Keeping enough log to process].
Related
Wiki: Keeping enough log to process
Frederic Marchal thanks for the reply.
Sorry, that is not in English communicated with Eugene :)
Thanks to your answers, I found a solution:
0 1 * * * root / bin / sarg -d day-1> / dev / null 2> & 1
0 * / 1 * * * root / bin / sarg -d day-0> / dev / null 2> & 1
This will create the report:
Good afternoon.

Could you tell why the report shows that it was done at 11 pm, when cron executes the task at 01:00?
0 1 * * root / bin / sarg -d day-1> / dev / null 2> & 1!
Last edit: Aleksey 2016-09-19
Do you have a job for sarg in /etc/cron.daily/ ?
No. Configured via /etc/crontab.
I do not know what changed, but the date of reporting became displayed normally.