Results 1 to 7 of 7

Thread: Mailboxd logs and editing crontab

  1. #1
    Paladinemishakal is offline Intermediate Member
    Join Date
    Jun 2012
    Posts
    21
    Rep Power
    3

    Default Mailboxd logs and editing crontab

    Hi All,

    I have 3 Zimbra 7.2.0_GA_2669 servers running as mail store and I have this problem where the log directory under /opt/zimbra is growing too big. I am looking at ways to reduce the number of days of logs to keep.

    I am looking at reducing this type of log: access_log.YYYY-MM-DD which the system is keeping 32 days worth of data.

    Checking in the crontab for zimbra user, I notice this particular line that is removing any log files that is older than 8 days:
    # crontab.store
    #
    # Log pruning
    #
    30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name \*log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1

    I checked in /opt/zimbra/mailboxd/logs directory, there is nothing in the directory. I also tried checking the /opt/zimbra/conf/log4j.properties and log4j.properties.in, the content did not contain any variables for me to configure the /opt/zimbra/mailboxd/logs.

    Questions:
    1. Where do I go to configure the logging properties for "access_log.YYYY-MM-DD" and made persistent changes?
    2. Is it possible for me to compress "access_log.YYYY-MM-DD" and cron it to delete the compressed logs?
    3. When listing the zimbra user's crontab, the file mention not to edit anything between the ZIMBRASTART and ZIMBRAEND, so how do make changes to the crontab?
    4. Does the changes I made, will be survive through Zimbra upgrades?

    Thanks & Regards.

  2. #2
    Paladinemishakal is offline Intermediate Member
    Join Date
    Jun 2012
    Posts
    21
    Rep Power
    3

    Default

    Hi All,

    I did a check with "zmprov gcf zimbraLogRawLifetime" and the system reply that it is set to 31d. Checking on my system, the only set of logfiles that about 31 days worth of data is the access_log.YYYY-MM-DD.

    I proceed to set it to 7d as follows:
    # zmprov mcf zimbraLogRawLifetime 7d
    # /opt/zimbra/libexec/zmlogprocess
    # /opt/zimbra/libexec/zmstatuslog

    Checking back in the /opt/zimbra/log, I still see the 31 days of access_log. Will it be clear by the cron the next it run? Anyone can help?

    Regards.

    Quote Originally Posted by Paladinemishakal View Post
    Hi All,

    I have 3 Zimbra 7.2.0_GA_2669 servers running as mail store and I have this problem where the log directory under /opt/zimbra is growing too big. I am looking at ways to reduce the number of days of logs to keep.

    I am looking at reducing this type of log: access_log.YYYY-MM-DD which the system is keeping 32 days worth of data.

    Checking in the crontab for zimbra user, I notice this particular line that is removing any log files that is older than 8 days:
    # crontab.store
    #
    # Log pruning
    #
    30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name \*log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1

    I checked in /opt/zimbra/mailboxd/logs directory, there is nothing in the directory. I also tried checking the /opt/zimbra/conf/log4j.properties and log4j.properties.in, the content did not contain any variables for me to configure the /opt/zimbra/mailboxd/logs.

    Questions:
    1. Where do I go to configure the logging properties for "access_log.YYYY-MM-DD" and made persistent changes?
    2. Is it possible for me to compress "access_log.YYYY-MM-DD" and cron it to delete the compressed logs?
    3. When listing the zimbra user's crontab, the file mention not to edit anything between the ZIMBRASTART and ZIMBRAEND, so how do make changes to the crontab?
    4. Does the changes I made, will be survive through Zimbra upgrades?

    Thanks & Regards.

  3. #3
    Paladinemishakal is offline Intermediate Member
    Join Date
    Jun 2012
    Posts
    21
    Rep Power
    3

    Default

    Hi All,

    I have finally found out where the configuration for this access_log.YYYY-MM-DD is.

    Here is the steps I have taken to find the process that is writing to the /opt/zimbra/log/access_log.2013-03-26:
    # fuser -a /opt/zimbra/log/access_log.2013-03-26
    /opt/zimbra/log/access_log.2013-03-26: 8096

    Checking in ps:
    # ps aux | grep 8096
    zimbra 8096 0.3 13.7 959588 282132 ? Sl Mar23 12:05 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -server -Djava.awt.headless=true -Dsun.net.inetaddr.ttl=60 -XX:+UseConcMarkSweepGC -XX:PermSize=128m -XX:MaxPermSize=128m -XX:SoftRefLRUPolicyMSPerMB=1 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:-OmitStackTraceInFastThrow -Xss256k -Xms512m -Xmx512m -Xmn128m -Djava.io.tmpdir=/opt/zimbra/mailboxd/work -Djava.library.path=/opt/zimbra/lib -Djava.endorsed.dirs=/opt/zimbra/mailboxd/common/endorsed -Dzimbra.config=/opt/zimbra/conf/localconfig.xml -Djetty.home=/opt/zimbra/mailboxd -DSTART=/opt/zimbra/mailboxd/etc/start.config -jar /opt/zimbra/mailboxd/start.jar /opt/zimbra/mailboxd/etc/jetty.properties /opt/zimbra/mailboxd/etc/jetty-setuid.xml /opt/zimbra/mailboxd/etc/jetty.xml

    Looking in each of the stated file, I found that the setting is in /opt/zimbra/mailboxd/etc/jetty.xml and /opt/zimbra/mailboxd/etc/jetty.xml.in
    Code:
        <!-- ============================================= -->
        <!-- Configure Request Log                                                    -->
        <!-- Request logs  may be configured for the entire server here,   -->
        <!-- or they can be configured for a specific web app in a           -->
        <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
        <!-- for an example).                                                            -->
        <!-- ============================================= -->
        <Ref id="RequestLog">
          <Set name="requestLog">
            <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
              <Arg><SystemProperty name="jetty.home" default="."/>/../log/access_log.yyyy_mm_dd</Arg>
              <Set name="logDateFormat">dd/MMM/yyyy:HH:mm:ss Z</Set>
              <Set name="retainDays">30</Set>
              <Set name="append">true</Set>
              <Set name="extended">true</Set>
              <Set name="filenameDateFormat">yyyy-MM-dd</Set>
              <Set name="preferProxiedForAddress">true</Set>
            </New>
          </Set>
        </Ref>
    Questions:
    1. Which files "jetty.xml" or "jetty.xml.in" do I edit?
    2. How do I effect the changes?
    3. What services do I need to restart? Is it "zmcontrol mailbox restart" or "zmmailboxdctl restart"?

    Hope someone can help me on this.

    Thanks & Regards,


    Quote Originally Posted by Paladinemishakal View Post
    Hi All,

    I have 3 Zimbra 7.2.0_GA_2669 servers running as mail store and I have this problem where the log directory under /opt/zimbra is growing too big. I am looking at ways to reduce the number of days of logs to keep.

    I am looking at reducing this type of log: access_log.YYYY-MM-DD which the system is keeping 32 days worth of data.

    Checking in the crontab for zimbra user, I notice this particular line that is removing any log files that is older than 8 days:
    # crontab.store
    #
    # Log pruning
    #
    30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name \*log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1

    I checked in /opt/zimbra/mailboxd/logs directory, there is nothing in the directory. I also tried checking the /opt/zimbra/conf/log4j.properties and log4j.properties.in, the content did not contain any variables for me to configure the /opt/zimbra/mailboxd/logs.

    Questions:
    1. Where do I go to configure the logging properties for "access_log.YYYY-MM-DD" and made persistent changes?
    2. Is it possible for me to compress "access_log.YYYY-MM-DD" and cron it to delete the compressed logs?
    3. When listing the zimbra user's crontab, the file mention not to edit anything between the ZIMBRASTART and ZIMBRAEND, so how do make changes to the crontab?
    4. Does the changes I made, will be survive through Zimbra upgrades?

    Thanks & Regards.

  4. #4
    speno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    57
    Rep Power
    5

    Default

    Edit jetty.xml.in and as the zimbra user, zmmailboxdctl restart should suffice. And no, it won't survive through Zimbra upgrades. Welcome to the world of Zimbra.
    Last edited by speno; 03-26-2013 at 02:52 PM.

  5. #5
    Paladinemishakal is offline Intermediate Member
    Join Date
    Jun 2012
    Posts
    21
    Rep Power
    3

    Default

    Hi Speno,

    Thanks for replying. This change is only localized to the mailstore that has the changes, correct?

    After I restart with zmmailboxdctl, I checked in /opt/zimbra/log, the 31days of access_log is still there, will the system remove the logs the next day?

    Regards.

    Quote Originally Posted by speno View Post
    Edit jetty.xml.in and as the zimbra user, zmmailboxdctl restart should suffice. And no, it won't survive through Zimbra upgrades. Welcome to the world of Zimbra.

  6. #6
    Paladinemishakal is offline Intermediate Member
    Join Date
    Jun 2012
    Posts
    21
    Rep Power
    3

    Default

    Hi All,

    I have checked on my server and the number of access_log is now reduced to 7 days + 2 (yesterday's log + today's log).

    Thanks everyone.


    Quote Originally Posted by Paladinemishakal View Post
    Hi Speno,

    Thanks for replying. This change is only localized to the mailstore that has the changes, correct?

    After I restart with zmmailboxdctl, I checked in /opt/zimbra/log, the 31days of access_log is still there, will the system remove the logs the next day?

    Regards.

  7. #7
    speno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    57
    Rep Power
    5

    Default

    Quote Originally Posted by Paladinemishakal View Post
    Hi Speno,

    Thanks for replying. This change is only localized to the mailstore that has the changes, correct?
    Yes, only on the mailstore where you made the change.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. My crontab is missing
    By marcio.santos in forum Installation
    Replies: 1
    Last Post: 11-27-2008, 10:07 AM
  2. no crontab for zimbra
    By fjimenez21 in forum Administrators
    Replies: 12
    Last Post: 03-25-2008, 09:05 AM
  3. crontab listing
    By bhickey in forum Administrators
    Replies: 0
    Last Post: 08-07-2007, 05:09 AM
  4. zmpurgemessages --> crontab ?
    By woeper in forum Users
    Replies: 0
    Last Post: 01-19-2007, 11:06 AM
  5. Crontab Errors
    By webguyinternet in forum Administrators
    Replies: 0
    Last Post: 09-20-2006, 11:20 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •