Squid and Logrotate
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Squid > Squid and Logrotate




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Squid and Logrotate  
malhard@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-10-06 12:14 AM

Hi all,

I am trying to configure logrotate, but I am having a lot of problems.

Can you help me?

Here you can find a brief desription of directories and files at my
machine:

/opt/squid/var/logs/ # ll
total 150903
-rw-r--r--    1 user  usergroup 66243001 Jun  9 17:04 access.log
-rw-r--r--    1 user  usergroup      303 Jun  8 15:36 cache.log
drwxr-xr-x    2 user  usergroup     4528 Jun  9 15:01 rotated
-rw-r--r--    1 user  usergroup        5 Jan 21 17:51 squid.pid
-rw-r--r--    1 user  usergroup 83165969 Jun  9 17:04 store.log


/opt/squid/var/logs> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.22736 installed on Fri Jun  9 17:02:20 2006)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp
$)
03 17 * * * /usr/sbin/logrotate /etc/logrotate.d/squid


/etc/ # cat logrotate.conf
# see "man logrotate" for details
# rotate log files daily
daily

# keep 30 days worth of backlogs
rotate 30

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp -- we'll rotate them here
#/var/log/wtmp {
#    monthly
#    create 0664 root utmp
#    rotate 1
#}

# system-specific logs may be also be configured here.


/etc/logrotate.d/ # cat squid
#testing logrotate for gxo03ipa
compress

/opt/squid/var/logs/access.log {
rotate 30
dateext
missingok
create 640 user usergroup
}

/opt/squid/var/logs/store.log {
rotate 20
dateext
missingok
create 640 user usergroup
postrotate
/etc/rc.d/squid reload
endscript
}

/opt/squid/etc/ #cat squid.conf
...
#  TAG: logfile_rotate
#       Specifies the number of logfile rotations to make when you
#       type 'squid -k rotate'.  The default is 10, which will rotate
#       with extensions 0 through 9.  Setting logfile_rotate to 0 will
#       disable the rotation, but the logfiles are still closed and
#       re-opened.  This will enable you to rename the logfiles
#       yourself just before sending the rotate signal.
#
#       Note, the 'squid -k rotate' command normally sends a USR1
#       signal to the running squid process.  In certain situations
#       (e.g. on Linux with Async I/O), USR1 is used for other
#       purposes, so -k rotate uses another signal.  It is best to get
#       in the habit of using 'squid -k rotate' instead of 'kill -USR1
#       <pid>'.
#
#Default:
logfile_rotate 0
...


/etc/ # ps -ef  | grep squid
user   1531     1  0 Jan21 ?        00:00:00 /opt/squid/sbin/squid -D
user   1533  1531  0 Jan21 ?        21:03:37 (squid) -D
root     22933 22757  0 17:11 pts/0    00:00:00 grep squid


Thanks.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:59 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register