squid logrotate的問題 - Linux

By Jacky
at 2013-08-13T14:11
at 2013-08-13T14:11
Table of Contents
這個問題困擾我一段時間了,
但我一直找不出原因,
請各位高手們幫忙。
我在CentOS 6.4上架了一台squid(版本3.1.10),並設定crontab在每天23:59分做rotate,
目前在測試階段,因此使用者只有2、3個人
觀察了幾天發現它都會提早去做rotate(但都是在我下班後),
不會在我設定好的時間去做rotate,
我想應該是提早做了,已經沒資料,所以不會去執行(不知我的觀念對不對?)
但我確定我設定crontab的指令是沒錯的
我也去看過/etc/logrotate.conf及/etc/logrotate.d/下的檔案
/etc/logrotate.d/下有一個squid檔,但它的rotate是weekly的,
所以我不知道為什麼它會自動去rotate?
請各位幫忙提點,謝謝!
以下是crontab及/etc/logrotate.d/squid的內容
crontab
10 5 * * * (/usr/sbin/ntpdate tock.stdtime.gov.tw && /sbin/hwclock -w) &> /dev/null
59 23 * * * /usr/sbin/squid -k rotate
1 0 * * * /usr/local/bin/sarg
/etc/logrotate.d/squid
/var/log/squid/*.log {
weekly
rotate 5
compress
notifempty
missingok
sharedscripts
postrotate
# Asks squid to reopen its logs. (log_rotate 0 is set in squid.conf)
# errors redirected to make it silent if squid is not running
/usr/sbin/squid -k rotate 2>/dev/null
# Wait a little to allow Squid to catch up before the logs is compressed
sleep 1
endscript
}
--
但我一直找不出原因,
請各位高手們幫忙。
我在CentOS 6.4上架了一台squid(版本3.1.10),並設定crontab在每天23:59分做rotate,
目前在測試階段,因此使用者只有2、3個人
觀察了幾天發現它都會提早去做rotate(但都是在我下班後),
不會在我設定好的時間去做rotate,
我想應該是提早做了,已經沒資料,所以不會去執行(不知我的觀念對不對?)
但我確定我設定crontab的指令是沒錯的
我也去看過/etc/logrotate.conf及/etc/logrotate.d/下的檔案
/etc/logrotate.d/下有一個squid檔,但它的rotate是weekly的,
所以我不知道為什麼它會自動去rotate?
請各位幫忙提點,謝謝!
以下是crontab及/etc/logrotate.d/squid的內容
crontab
10 5 * * * (/usr/sbin/ntpdate tock.stdtime.gov.tw && /sbin/hwclock -w) &> /dev/null
59 23 * * * /usr/sbin/squid -k rotate
1 0 * * * /usr/local/bin/sarg
/etc/logrotate.d/squid
/var/log/squid/*.log {
weekly
rotate 5
compress
notifempty
missingok
sharedscripts
postrotate
# Asks squid to reopen its logs. (log_rotate 0 is set in squid.conf)
# errors redirected to make it silent if squid is not running
/usr/sbin/squid -k rotate 2>/dev/null
# Wait a little to allow Squid to catch up before the logs is compressed
sleep 1
endscript
}
--
Tags:
Linux
All Comments

By Ina
at 2013-08-15T02:23
at 2013-08-15T02:23

By Caitlin
at 2013-08-17T07:30
at 2013-08-17T07:30

By Audriana
at 2013-08-19T11:55
at 2013-08-19T11:55

By Sandy
at 2013-08-24T09:59
at 2013-08-24T09:59

By Carol
at 2013-08-28T17:21
at 2013-08-28T17:21
Related Posts
Linux kernel 3.10.6 "TOSSUG Baby Fish"

By Elizabeth
at 2013-08-13T13:38
at 2013-08-13T13:38
Linux process power 的問題

By Faithe
at 2013-08-12T18:41
at 2013-08-12T18:41
KDE Taiwan 網站改版中

By Kelly
at 2013-08-12T15:51
at 2013-08-12T15:51
windows 下 cygwin 執行 bash 的問題

By Valerie
at 2013-08-12T15:08
at 2013-08-12T15:08
HackingThursday 固定聚會 (2013-08-15)

By Brianna
at 2013-08-12T12:06
at 2013-08-12T12:06