View previous topic :: View next topic |
Author |
Message |
Kendrick n00b
Joined: 31 Oct 2010 Posts: 2
|
Posted: Sun Oct 31, 2010 5:10 am Post subject: Logrotate config issue. |
|
|
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 |
|
|
Stu_28 Tux's lil' helper
Joined: 12 Jun 2003 Posts: 129
|
Posted: Sun Oct 31, 2010 12:21 pm Post subject: |
|
|
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 |
|
|
Kendrick n00b
Joined: 31 Oct 2010 Posts: 2
|
Posted: Mon Nov 01, 2010 1:26 am Post subject: |
|
|
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 |
|
|
|