Package: logrotate
Version: 3.8.1-4
When "olddir" and "prerotate" are set, the absolute path to the log
file passed to "prerotate" includes the "olddir".
$ cat test-sdk
/tmp/sdk/message.log.2015-08-15 {
olddir rotated
rotate 0
dateext
dateformat
daily
missingok
notifempty
nocreate
nocompress
nosharedscripts
prerotate
echo $1
exit 1
endscript
}
$ logrotate -f -v test-sdk
reading config file test-sdk
olddir is now rotated
Handling 1 logs
rotating pattern: /tmp/sdk/message.log.2015-08-15 forced from command
line (no old logs will be kept)
olddir is rotated, empty log files are not rotated, old logs are removed
considering log /tmp/sdk/message.log.2015-08-15
log needs rotating
rotating log /tmp/sdk/message.log.2015-08-15, log->rotateCount is 0
Converted '' -> ''
dateext suffix ''
glob pattern ''
glob finding old rotated logs failed
running prerotate script
/tmp/sdk/rotated/message.log.2015-08-15
error: error running non-shared prerotate script for
/tmp/sdk/message.log.2015-08-15 of '/tmp/sdk/message.log.2015-08-15 '
I suggest that the absolute path to the log file passed to "prerotate"
doesn't include the "olddir".
"postrotate" includes the "olddir".
--
mandi, Marco