Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Logrotate config issue.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Kendrick
n00b
n00b


Joined: 31 Oct 2010
Posts: 2

PostPosted: Sun Oct 31, 2010 5:10 am    Post subject: Logrotate config issue. Reply with quote

I am trying to get logrotate to use 7z as the compression utility. I have tried to use various settings in the logrotate.d/ files i am not able to get it to run properly.

Code:
/var/log/mail.* {
        weekly
        compress
        size 100M
        missingok
        compresscmd /usr/bin/7z
        compressoptions "a -t7z"
        compressext .7z
        sharedscripts
        postrotate
            /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
        endscript
}
Back to top
View user's profile Send private message
Stu_28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2003
Posts: 129

PostPosted: Sun Oct 31, 2010 12:21 pm    Post subject: Reply with quote

7z is an archiver, like tar, not just a compression utility. So, part of the command is the archive name--`7z a somearchive.7z filenames`. But, logrotate is expecting a simple compression utility--`gzip filename`. If you want the files compressed using the same thing 7z does, use xz instead (app-arch/xz-utils). Something like this should work:

Code:

/var/log/mail.* {
        weekly
        compress
        size 100M
        missingok
        compresscmd /usr/bin/xz
        compressoptions -9
        compressext .xz
        sharedscripts
        postrotate
            /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
        endscript
}
Back to top
View user's profile Send private message
Kendrick
n00b
n00b


Joined: 31 Oct 2010
Posts: 2

PostPosted: Mon Nov 01, 2010 1:26 am    Post subject: Reply with quote

that was the info i needed I modified p7zip script with the remaining settings and now 7z works great for logs. /usr/bin/p7zip and set the extension. for what ever reason I was getting errors previously from p7zip adding the extra type and such options made the difference.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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