On Sat, Jan 17, 2009 at 10:15:16PM +0100, [email protected] wrote:
> I installed the new logrotate from sid, and added to
> /etc/logrotate.conf, before "include /etc/logrotate.d", the
> directives:
> shred
> shredcycles 2
>
> I then wanted to make sure the specified shredcycles option was taken
> into account, and then wrote into /usr/local/sbin/shred :
>
> #!/bin/sh
> set -x
> /usr/bin/shred $@
>
> Running as root 'logrotate -v -f /etc/logrotate.conf' outputs on
> stderr includes:
> + /usr/bin/shred -u /var/log/apache2/access.log.1
>
> So our custom shred is effectively called, but without the expected
> '-n 2' option.
Odd. The code seems right, but I can confirm your problem.
The "shredcycles" setting isn't being copied across from the outer block
into the inner blocks. The following works:
/tmp/test {
shred
shredcycles 1
missingok
monthly
rotate 1
}
But the following doesn't:
shred
shredcycles 1
/tmp/test {
missingok
monthly
rotate 1
}
Found it. The function copyLogInfo() doesn't copy across all the settings.
--
Paul Martin <[email protected]>
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]