Have you looked into the overwrite_report option in sarg.conf? Its description is available in the wiki page [Report options].
# TAG: overwrite_report yes|no
# yes - if report date already exist then will be overwrited.
# no - if report date already exist then will be renamed to filename.n, filename.n+1
#
#overwrite_report no
Its default value is "no" meaning it does what you describe.
I suggest you add the following line to your sarg.conf
overwrite_report yes
Your sarg.conf appears to be /usr/local/etc/sarg.conf.daily according to the output you posted.
Hello
Latest sarg-2.4.0-pre2 taken from GIT and running on CENTOS 7.2 crates
[root@htpc2 daily]# ll
итого 40
drwxr-xr-x 4 root root 4096 янв 19 10:07 2017Jan19-2017Jan19
drwxr-xr-x 4 root root 4096 янв 19 10:02 2017Jan19-2017Jan19.1
drwxr-xr-x 4 root root 4096 янв 19 10:02 2017Jan19-2017Jan19.2
drwxr-xr-x 4 root root 4096 янв 19 10:02 2017Jan19-2017Jan19.3
drwxr-xr-x 4 root root 4096 янв 19 10:03 2017Jan19-2017Jan19.4
drwxr-xr-x 4 root root 4096 янв 19 10:05 2017Jan19-2017Jan19.5
drwxr-xr-x 4 root root 4096 янв 19 10:07 2017Jan19-2017Jan19.6
drwxr-xr-x 4 root root 4096 янв 19 10:07 2017Jan19-2017Jan19.7
drwxr-xr-x 2 root root 88 янв 19 10:02 images
-rw-r--r-- 1 root root 6337 янв 19 10:07 index.html
instead oа rewriting it as just
drwxr-xr-x 4 root root 4096 янв 19 10:07 2017Jan19-2017Jan19
**if i use option
--lastlog 1
it rewrite previous day report with new day.
This it not as it was before and not what is need. I need to keep previous day report and update today report every 5 min.
**
I start it as
[root@htpc2 daily]# crontab -l | grep -i daily
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/sarg_daily.sh > /var/log/sarg_daily.log 2>&1 #daily sarg
And use script with default sarg.con file
[root@htpc2 bin]# cat ./sarg_daily.sh
#!/bin/sh
if [ ! -d /tmp/sarg_daily ]
then
mkdir /tmp/sarg_daily
fi
TODAY=$(date +%d/%m/%Y);
YESTERDAY=$(date --date "1 day ago" +%d/%m/%Y);
/usr/local/bin/sarg \
-f /usr/local/etc/sarg.conf.daily \
-d "$TODAY-$TODAY" \
-w /tmp/sarg_daily \
-o /var/www/html/squid-reports/daily \
-z
How to make it work in usual way - keeping one report for every day?
Kind thanks!
Regards,
Igor
Last edit: igor 2017-01-19
here is the index page
Have you looked into the
overwrite_reportoption in sarg.conf? Its description is available in the wiki page [Report options].Its default value is "no" meaning it does what you describe.
I suggest you add the following line to your
sarg.confYour
sarg.confappears to be/usr/local/etc/sarg.conf.dailyaccording to the output you posted.Related
Wiki: Report options
Yes, with "overwrite_report yes" it does not produce report versions!
I should noticed it myself !!! I am very soory.
Thanks you very much for exellent application and good help!
Last edit: igor 2017-01-19