Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-2010, 07:54 AM
Starter Member
 
Posts: 1
Default Logrotate, changing defaults!

I know this more of a Linux question than Zimbra, but maybe some of you have already done it and can help. I'd like to keep more versions of the /var/log/maillog and /var/log/zimbra.log, to e exact 36 days. So I changed the logrotate conf:

/etc/logrotate.d/zimbra to:

/var/log/zimbra.log {
daily
rotate 36 # Keep the last 36 days
missingok
notifempty
olddir /var/log/archive
create 0644 zimbra zimbra
postrotate
killall -HUP syslogd 2> /dev/null || true
su - zimbra -c "/opt/zimbra/bin/zmswatchctl restart" > /dev/null 2>&1 || true
endscript
compress
}

But this just doesn´t want to work! Any ideas on that one?

ThanX.
Reply With Quote
  #2 (permalink)  
Old 07-19-2010, 11:19 AM
Advanced Member
 
Posts: 205
Default

Move the comment off the rotate line?

per the man page for logrotate;

Code:
Note that comments may appear anywhere in the config file as long as the first non-whitespace character on the line is a #.
Reply With Quote
  #3 (permalink)  
Old 07-20-2010, 02:24 AM
Junior Member
 
Posts: 8
Default

ThanX jrefl5, I will check on that!
Reply With Quote
  #4 (permalink)  
Old 01-13-2011, 01:07 AM
New Member
 
Posts: 4
Default

hi all!

I changed the /etc/logrotate.d/zimbra :
Code:
/var/log/zimbra.log {
    daily
    rotate 365
    missingok
    notifempty
    create 0644 zimbra zimbra
    postrotate
      killall -HUP syslogd 2> /dev/null || true
      su - zimbra -c "/opt/zimbra/bin/zmswatchctl restart" > /dev/null 2>&1 || true
    endscript
    compress
}
But it didn't help. The number of logs remains unchanged as set by default. Default numbers of logs equal is 7.
Any idea?

Last edited by momok; 01-13-2011 at 01:12 AM..
Reply With Quote
  #5 (permalink)  
Old 01-13-2011, 07:51 AM
Moderator
 
Posts: 1,209
Default

I'm not 100% sure, but have you tried doing as the zimbra user:

Code:
zmlogswatchctl stop; zmlogswatchctl start; zmlogswatchctl status
after you edited /etc/logrotate.d/zimbra?

Hope that helps,
Mark
__________________
___________________________________
L. Mark Stone, CIO


"Uptime. All the time."

477 Congress Street | Portland, ME 04101-3431 | (207) 772-5678

proactive maintenance and monitoring | technology consulting
Zimbra groupware | EMR implementations | private cloud hosting
Reply With Quote
  #6 (permalink)  
Old 01-14-2011, 12:47 AM
New Member
 
Posts: 4
Default

So I changed the logrotate:

/etc/logrotate.d/zimbra

Code:
/var/log/zimbra.log {
    daily
    rotate 365
    missingok
    notifempty
    noolddir
    create 0644 zimbra zimbra
    postrotate
      killall -HUP syslogd 2> /dev/null || true
      su - zimbra -c "/opt/zimbra/bin/zmswatchctl restart" > /dev/null 2>&1 || true
    endscript
    compress
}
Than I added "noolddir" setting and it started to work
All changes were made as root.
Reply With Quote
  #7 (permalink)  
Old 05-19-2011, 04:11 PM
Member
 
Posts: 10
Default

The issue it seems is that the crontab for the zimbra user. It purges log files that are modified older than 8 days, so no matter how you change the logrotate option it will only keep 8 days

the command that does this:
30 2 * * * find /opt/zimbra/log/ -type f -name \*.log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.