newsyslog.conf / rotating logs based on size AND time

Zbigniew Szalbot z.szalbot at
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/      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
-------------- 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 :

More information about the freebsd-questions mailing list