[squid-users] Log rotate
sampei02 at tiscali.it
sampei02 at tiscali.it
Mon Dec 7 09:35:21 UTC 2020
My OS is Centos 7.
But I manage rotation by logrotate, according to your suggestions in /etc/logrotate.d/squid, among postscript and endscript, there is written 'squid -k rotate’ so you don’t invoke squid rotation too ?!? We have 2 rotations?
> On 7 Dec 2020, at 10:08, Matus UHLAR - fantomas <uhlar at fantomas.sk> wrote:
>
> On 07.12.20 09:12, sampei02 at tiscali.it <mailto:sampei02 at tiscali.it> wrote:
>> I want to rotate access.log by logrotate system process so I disabled
>> rotation in squid.conf, logfile_rotate has been set to zero; by logrotate
>> I can compress log files and to name them with date suffix.
>
>> But what I have to write among postrotate and endscript ? What command to
>> send to squid to start rotation?
>
>> It’s right to write "squid -k rotate" in postrotate section if I wanted to
>> manage rotation only by logrotate?
>
>
> this is very common on debian-based systems.
>
>> This is my /etc/logorotate.d/ file
>>
>> var/log/squid/access.log {
>> daily
>> compress
>> rotate 365
>> missingok
>> nocreate
>> sharedscripts
>> postrotate
>> test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate 2>/dev/null
>> endscript
>> }
>
> are you sure you don't run debian? ;-)
> I would just like to avoit redirecting stderr to /dev/null
> - if something bad happens, you should know it and not flush the info
>
>
> /var/log/squid/*.log {
> daily
> compress
> delaycompress
> rotate 31
> missingok
> nocreate
> sharedscripts
> prerotate
> test ! -x /usr/sbin/sarg-reports || /usr/sbin/sarg-reports daily
> endscript
> postrotate
> test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
> endscript
> }
>
>
> --
> Matus UHLAR - fantomas, uhlar at fantomas.sk <mailto:uhlar at fantomas.sk> ; http://www.fantomas.sk/ <http://www.fantomas.sk/>
> Warning: I wish NOT to receive e-mail advertising to this address.
> Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
> Linux - It's now safe to turn on your computer.
> Linux - Teraz mozete pocitac bez obav zapnut.
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org <mailto:squid-users at lists.squid-cache.org>
> http://lists.squid-cache.org/listinfo/squid-users <http://lists.squid-cache.org/listinfo/squid-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20201207/03d525b7/attachment-0001.htm>
More information about the squid-users
mailing list