newsyslog.conf / rotating logs based on size AND time

Zbigniew Szalbot z.szalbot at lcwords.com
Tue Aug 5 08:17:11 UTC 2008


Hi there,

I have the following rule in /etc/newsyslog.conf
var/log/*-access.log           644  12    24000    $W2D11 GZC 
/var/run/httpd.pid      30

I am trying to see if I can specify to rotate logs when they are larger 
then 24MB AND at the start of each month (for testing purposes I entered 
today at 11 o'clock - $W2D11).

However, at 10 o'clock the log should have been rotated because of size:
-rw-r--r--  1 root   wheel    24801986 Aug  5 10:02 domain.tld-access.log
but as you can see, it was not.

My question is how can I make sure the logs are rotated when they grow 
too large AND they are also rotated at a specified point in time (start 
of a new month).

I am reading man newsyslog.conf and it says:

If the when field contains an asterisk (`*'), log rotation will solely 
depend on the contents of the size field.

To me it seems to say that when it is not an asterisk (i.e. when I enter 
a date), the log rotation is not based solely on size factor, which in 
other words should mean it is also based on time?

Any help would be very much appreciated!

Thank you in advance!

-- 
Zbigniew Szalbot
www.LCWords.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3253 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20080805/c63c7c84/smime.bin


More information about the freebsd-questions mailing list