A logrotate file that can be installed into logrotate.d is useful to assist in pruning logs.
Please note that it's on purpose that I don't use sharedscripts. Specifically the man page states this:
Normally, prerotate and postrotate scripts are run for each log which is rotated, meaning that a single script may be run multiple times for log file entries which match multiple files (such as the /var/log/news/* exam-
ple). If sharedscript is specified, the scripts are only run once, no matter how many logs match the wildcarded pattern. However, if none of the logs in the pattern require rotating, the scripts will not be run at all.
If the scripts exit with error, the remaining actions will not be executed for any logs. This option overrides the nosharedscripts option and implies create option.
What it neglects to add is that normally the rotation sequence is this:
* link() to new name
* unlink() old name
* run postrotate script
* run compression
When using sharedscripts the last two steps effectively swaps around, to be precise each log file is first linked to the new name, then unlinked, then compressed, and only after this has been done for all files that needs to be rotated will the postrotate script be run. At least, this was the case last time I checked. Two ways around this:
a) don't use sharedscripts
b) also use delaycompress
Steps to Reproduce:
Created attachment 239687 [details]
+*asterisk-188.8.131.52-r1 (20 Aug 2010)
+ 20 Aug 2010; <email@example.com> asterisk-1.2.40.ebuild,
+ asterisk-184.108.40.206.ebuild, asterisk-220.127.116.11.ebuild,
+ +files/1.6.2/asterisk.initd2, +files/1.6.2/asterisk.logrotate,
+ Tweak nm call to avoid binary deletion as requested by Alexey McSakoff in
+ bug #302736. Bashims removed from init script by Kerin Millar & Federico
+ Santulli, closes bug #309277. Stock audio prompts now split out to
+ separate ebuilds and logrotate support thanks to Jaco Kroon, closes bug
+ #328513 & #329281 respectively.
with the logrotate USE flag cron say :
error: asterisk:24 unknown option 'rotations' -- ignoring line
error: asterisk:24 unexpected text
(my emerge --info is attached)
Created attachment 245387 [details]
New issue, new bug. Do not attempt to reopen this report; it was a feature request which was actioned.