# Logrotate does not create daily tarballs

## audiodef

I used to have logrotate working and creating tarballs on a daily basis, keeping only the last few days. This kept my log sizes down. Now it's not and I don't know why. 

/etc/logrotate.conf:

```

daily

rotate 5

create

dateext

compress

include /etc/logrotate.d

notifempty

mail (some_email)

size 1M

noolddir

/var/log/wtmp {

    monthly

    create 0664 root utmp

    rotate 1

}

/var/log/btmp {

    missingok

    monthly

    create 0600 root utmp

    rotate 1

}

```

/etc/logrotate.d/syslog-ng:

```

/var/log/debug /var/log/syslog {

    daily

    compress

    rotate 7

    sharedscripts

    missingok

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

/var/log/cron.log {

    daily

    compress

    rotate 7

    sharedscripts

    missingok

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

/var/log/mail.log /var/log/mail.info /var/log/mail.err /var/log/mail.warn {

    daily

    compress

    rotate 7

    sharedscripts

    missingok

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

/var/log/auth.log {

    daily

    compress

    rotate 7

    sharedscripts

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

/var/log/messages {

    daily

    compress

    rotate 4

    sharedscripts

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

/var/log/apache/* {

    daily

    compress

    rotate 2

    sharedscripts

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

/var/log/icecast/* {

    daily

    compress

    rotate 2

    sharedscripts

    postrotate

        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true

    endscript

}

```

Am I missing something?

----------

## khayyam

audiodef ...

at a glance what seems to be the issue is that your HUP'ing syslog-ng, rather than the daemons, and so the daemons are not aware that they are writing to a rotated log.

So, for the syslog-ng HUP syslog-ng, and for {mailserver} the /etc/init.d/{mailserver}, eg:

/etc/logrotate.d/postfix

```
/var/log/mail.log /var/log/mail.err /var/log/mail.warn {

    missingok

    notifempty

    weekly

    rotate 3

    compress

    compresscmd /bin/bzip2

    compressext .bz2

    sharedscripts

    postrotate

        /etc/init.d/postfix reload > /dev/null 2>&1 || true

    endscript

}
```

Similarly with *cron, etc.

Some other possible problems 1).  /var/log/messages is created by syslog-ng so your doubling the action having both a 'syslog-ng' and 'messages', you should include 'messages' in that rotation ... infact, I'm not really sure why you have a '/var/log/syslog' as 'messages' is syslogs-ng's logfile, 2). with a wildcard in 'apache', and 'icecast' this will rotate the previously rotated logs, as the wildcard will also match previous rotations, so do as you do with 'mailsever' and stipulate the files, 3). auth.log is written by login, so there is no need to HUP syslog-ng (and actually, unless you have a lot of logins it doesn't make much sense to rotate daily). 

HTH & best ... khay

----------

