Results 1 to 7 of 7

Thread: Logrotate, changing defaults!

  1. #1
    Join Date
    Feb 2010
    Location
    Hamburg, Germany
    Posts
    1
    Rep Power
    5

    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.

  2. #2
    Join Date
    Nov 2007
    Location
    AZ, USA
    Posts
    205
    Rep Power
    7

    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 #.

  3. #3
    Join Date
    Jul 2009
    Location
    Hamburg
    Posts
    8
    Rep Power
    6

    Default

    ThanX jrefl5, I will check on that!

  4. #4
    Join Date
    Oct 2010
    Location
    Moscow, Russia
    Posts
    4
    Rep Power
    5

    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.

  5. #5
    Join Date
    Sep 2006
    Location
    477 Congress Street | Portland, ME 04101
    Posts
    1,374
    Rep Power
    11

    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

  6. #6
    Join Date
    Oct 2010
    Location
    Moscow, Russia
    Posts
    4
    Rep Power
    5

    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.

  7. #7
    Join Date
    Oct 2009
    Posts
    12
    Rep Power
    6

    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

Similar Threads

  1. Clients stopped receiving emails
    By egadinc in forum Administrators
    Replies: 16
    Last Post: 12-14-2009, 02:38 PM
  2. Zimbra + Samba + changing passwords
    By agfeller in forum Administrators
    Replies: 2
    Last Post: 07-01-2007, 01:28 AM
  3. Changing server name
    By lilwong in forum Administrators
    Replies: 24
    Last Post: 03-26-2007, 01:09 PM
  4. changing COS problems...
    By urban@abak in forum Administrators
    Replies: 3
    Last Post: 01-31-2007, 05:54 AM
  5. MTA is Dying after yum update
    By tonyawbrey in forum Administrators
    Replies: 27
    Last Post: 04-02-2006, 06:11 PM

Posting Permissions

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