Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Logrotate does not create daily tarballs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6316
Location: /usr/lib64/lv2

PostPosted: Tue Oct 30, 2012 2:00 pm    Post subject: Logrotate does not create daily tarballs Reply with quote

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:
Code:

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:
Code:

/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?
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Oct 30, 2012 3:01 pm    Post subject: Reply with quote

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
Code:
/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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum